cat ~/.ssh/id_rsa.pub | ssh user@host ‘cat >> .ssh/authorized_keys’
To open port 8983 up for example (replace IP as appropriate):
ssh -N -L localhost:8983:127.0.0.1:8983 firstname.lastname@example.org -i ~/Documents/srv/puphpet/files/dot/ssh/id_rsa
Then in your browser you can access http://localhost:8983/solr without issues! 😀
Here’s one you might have had. “Lost connection to MySQL server at ‘reading initial communication packet’ “.
If you get this, then I assume that you are connecting to another machine on the network, a virtual machine, or a remote server.
It’s a pretty simple fix. Edit your /etc/mysql/my.cnf (path may differ depending on your setup), and change the line that says bind-address = 127.0.0.1 to:
bind-address = 0.0.0.0
Save it, then restart mysql.
sudo service mysql restart
I love IRC. My friend just doesn’t get it however. But he isn’t looking in the right places.
For instance, we are having a hellish time with our server migration in work today. Our site was transferred to a bigger better CentOS cPanel server, only to act very strangely and mess up. Checking logs only tells us so much, so I tried to get XDebug installed on the server. I was having issues, and so went into freenode and joined the ##php channel, where I was redirected to #xdebug, where I received direct help from XDebugs main contributor, Derick Rethans! You couldn’t ask for better assistance!
Anyway, lets get it installed. Log in to your server as root, and download the xdebug source code. Then run the following from within the source folder:
phpize ./configure make make install
Then edit your php.ini, with the following:
zend_extension=xdebug.so xdebug.remote_enable=On xdebug.remote_port=9000 xdebug.remote_handler="dbgp" xdebug.remote_autostart=0 xdebug.remote_connect_back=0 xdebug.idekey = PHPSTORM xdebug.max_nesting_level = 250 xdebug.remote_log = "/home/allagent/xdebuglog" xdebug.remote_host = 127.0.0.1
Now there are a couple of settings to be aware of. As I am in work and behind a router, connect_back = 1 wouldn’t work. If you can set up port forwarding on your router, then do so! And remove the remote host 127.0.0.1 line. If not, we set it as 0, and set up an SSH tunnel. Derick sent me his blog link explaining how this is done so check it out here:
In PHPStorm (you are using storm, right?), goto your run/debug configurations and add a PHP Web Application. I called mine LiveDebug, but you can call it whatever you like. In the server drop down, add your server, tick use path mappings, find your index.php, and stick in the absolute path for the same file on the remote server (something like /home/username/public_html/index.php). You should do the same with the document root, which means it shopuld find all the rest without having to manually set each page/file.
Now for the good bit! Set a breakpoint in your code by clicking to the left of the code but to the right of the line numbers. A red spot should appear to signify you wish to pause the code at that point for inspection. Click the Run menu, and click debug. Then select LiveDebug, or whatever you called it. a browser window should open, and in Storm the debug frame will pop out. Click the variables tab. You can see every variable as it is set at that line of code. To the right of the tabs you have buttons for skipping over code, and stepping into functions etc! Have fun!
Now hopefully I can figure out why this new server is acting up!
I’ve looked this up LOADS of times as its something you’ll want to do no doubt, much as you love PHPMyAdmin (ha!)
GRANT ALL PRIVILEGES ON *.* TO username@"%" IDENTIFIED BY 'password'; FLUSH PRIVILEGES; Now you can use SequelPro, MySQLWorkbench, Navicat, or whatever thing you like to use