Essential Articles on Remote PHP Debugging with PHPStorm and Xdebug

Steps:

 

Enable remote xdebug in php.ini 

you will add a line in php.ini

xdebug.remote_enable=1

Test your connection, if it doesn’t work with localhost, try you local network IP address as it depends to which network adapter PHPStorm is using for the debugging purposes.

 

Mac-Pro:~ mac$ telnet localhost 9000

Trying ::1…

telnet: connect to address ::1: Connection refused

Trying 127.0.0.1…

Connected to localhost.

Escape character is ‘^]’.

^\^]

telnet> exit

?Invalid command

telnet> quit

Connection closed.

Mac-Pro:~ mac$ telnet 192.168.1.8 9000

Trying 192.168.1.8…

Connected to 192.168.1.8.

Escape character is ‘^]’.

 

 

http://randyfay.com/content/remote-drupalphp-debugging-xdebug-and-phpstorm

http://randyfay.com/content/remote-command-line-debugging-phpstorm-phpdrupal-including-drush

PHP Broken Pipe (mod_fcgid: ap_pass_brigade failed in handle_request_ipc function)

 

 If you get this error with VirtualMin.

This is a PHP-FCGI limit error you’re receiving. You’ll need to adjust either the “PHP_FCGI_MAX_REQUESTS” variable inside the “/home/user/fcgi-bin/php5.fcgi” file for the domain or “FcgidMaxRequestsPerProcess” variable inside the Apache config file.

You can read more about this topic at:

http://httpd.apache.org/mod_fcgid/mod/mod_fcgid.html#examples

” 

 

Creds: https://www.virtualmin.com/node/32108

Fix php-mcrypt bug in Ubuntu 14.04

 

This one liner will fix your php-mcrypt, the last command tests to ensure mcrypt is properly installed.

sudo ln -sf /etc/php5/conf.d/mcrypt.ini && sudo php5enmod mcrypt && sudo service apache2 restart && php -m | grep mcrypt 

 

Source:

https://bugs.launchpad.net/ubuntu/+source/php-mcrypt/+bug/1318021

 

This does solve it:

Check if mcrypt is not enabled:

root@prod:/etc/php5/mods-available# php -m | grep mcrypt

Symlinks to the wrong mcrypt.ini as a workaround:

root@prod:/etc/php5/mods-available# ln -sf /etc/php5/conf.d/mcrypt.ini .

Enabled the mcrypt mod:

root@prod:/etc/php5/mods-available# php5enmod mcrypt

Check if it was enabled:

root@prod:/etc/php5/mods-available# php -m | grep mcrypt

Restart services:

root@prod:/etc/php5/mods-available# service apache2 restart

php -m | grep mcrypt

 

Adding SSH2 to MAMP and MAMP PRO on Yosemite the easy way

 

You will require autoconf.

http://mac-dev-env.patrickbougie.com/autoconf/

Install via the above instructions will work. Also, using Homebrew will work.

Cannot find autoconf. Please check your autoconf installation and the

$PHP_AUTOCONF environment variable. Then, rerun this script.

Download the php version that matches the one you will be using with MAMP Pro.

Copy the extracted files to MAMP php folder in /Applications/MAMP/bin/php/php5.5.18/include/php

Do not copy the subfolder created by the extraction, only copy the contents of that folder. You may have to create the ‘include/php/‘ folders as they might not already exist.

Also, do change the PHP version number to match the one you’re using.

./configure --without-iconv

Adding SSH2 extension to your MAMP the sure way

  1. Download libssh2 from source forge, direct link here
  2. Then extract the package, configure, compile and install it.
    user:compile$ tar -xf libssh2-1.2.1.tar
    user:compile$ cd libssh2-1.2.1
    user:libssh2-1.2.1$ ./configure
    user:libssh2-1.2.1$ make
    user:libssh2-1.2.1$ sudo make install
    Password:
    
  3. Download SSH2 PECL source code, get the latest stable version.
  4. Then untar and compile it.
    user:compile$ tar -xf ssh2-0.12.0.tar
    user:compile$ cd ssh2-0.12.0
    user:ssh2-0.12.0$ phpize
    If you don’t have have autoconf installed this is where you will get an error. Cannot find autoconf. Otherwise, proceed.
    user:ssh2-0.11.0$ ./configure
     
    If you get this error

    /Applications/MAMP/bin/php/php5.5.18/include/php/Zend/zend.h:51:11: fatal error: ‘zend_config.h’

          file not found


     
    This is probably because you did not compile the PHP you downloaded.
     
    user:ssh2-0.11.0$ make
    
     
  5. Look in
    ssh2-0.12.0/modules/ to find ssh2.so
    Copy this file to your MAMP location.
  6. Chmod 755 the location of your ssh2.so file.
  7. Edit templates in MAMP Pro, File->Edit Template->PHP-> Choose the PHP version you have compiled with.
  8. Add the line , in the [extensions] section
    1. extension=ssh2.so
  9. Save changes
  10. Restart MAMP Pro
  11. Check phpinfo()
  12. Try it out

2015 03 01 11 47 08 PM 

If you are using Linux, such as Debian, Ubuntu you can install XAMPP for Linux. Compile ssh2 using the same instructions, update the php.ini file the same way. 

 

 

Creds: http://stackoverflow.com/questions/10717752/having-problems-while-try-to-install-oauth-with-pecl-in-mamp-on-mac-os-lion

http://stackoverflow.com/questions/24987305/php-configure-error-please-specify-the-install-prefix-of-iconv-with-with-icon