I am desperately searching for a nice IDE for PHP allowing me to debug. Therefore I am currently evaluating PHPStorm. As soon as I have manged to get the setup running, I will buy a license.
Basically, I have a html file with jsvascript embedded. This js calls the PHP files within the same project. I would of course like to debug both js and PHP but I would be very happy if at least the IDE would stop at the breakpoint in the PHP as soon as I am calling the PHP script.
As I tried several IDEs before, my MAC seems to be messed up. I therefore need some help.
I have MAMP running with PHP 5.5.3 on port 8888. The files I am copying into its htdocs folder are successfully executed. Calling phpinfo() in one of these pages returns the PHP info page with the following settings:
PHP Version 5.5.3
||'./configure' '--with-mysql=/Applications/MAMP/Library' '--with-apxs2=/Applications/MAMP/Library/bin/apxs' '--with-gd' '--with-jpeg-dir=/Applications/MAMP/Library' '--with-png-dir=/Applications/MAMP/Library' '--with-zlib' '--with-freetype-dir=/Applications/MAMP/Library' '--prefix=/Applications/MAMP/bin/php/php5.5.3' '--exec-prefix=/Applications/MAMP/bin/php/php5.5.3' '--sysconfdir=/Applications/MAMP/bin/php/php5.5.3/conf' '--with-config-file-path=/Applications/MAMP/bin/php/php5.5.3/conf' '--enable-ftp' '--enable-gd-native-ttf' '--with-bz2=/usr' '--with-ldap' '--with-mysqli=/Applications/MAMP/Library/bin/mysql_config' '--with-t1lib=/Applications/MAMP/Library' '--enable-mbstring=all' '--with-curl=/Applications/MAMP/Library' '--enable-sockets' '--enable-bcmath' '--with-imap=shared,/Applications/MAMP/Library/lib/imap-2007f' '--enable-soap' '--with-kerberos' '--enable-calendar' '--with-pgsql=shared,/Applications/MAMP/Library/pg' '--enable-exif' '--with-libxml-dir=/Applications/MAMP/Library' '--with-gettext=shared,/Applications/MAMP/Library' '--with-xsl=/Applications/MAMP/Library' '--with-pdo-mysql=shared,/Applications/MAMP/Library' '--with-pdo-pgsql=shared,/Applications/MAMP/Library/pg' '--with-mcrypt=shared,/Applications/MAMP/Library' '--with-openssl' '--enable-zip' '--with-iconv=/Applications/MAMP/Library' '--enable-opcache'
||Apache 2.0 Handler
|Virtual Directory Support
|Configuration File (php.ini) Path
|Loaded Configuration File
The php.ini file mentioned (at /Applications/MAMP/bin/php/php5.5.3/conf/php.ini) states the following:
; Directory in which the loadable extensions (modules) reside.
extension_dir = "/Applications/MAMP/bin/php/php5.5.3/lib/php/extensions/no-debug-non-zts-20121212/"
The file xdebug.so can be found at this location but I don't know how to test if its the right version.
In PHPStorm, I have set the PHP version to 5.5 (language level) and the interpreter to 5.5.3 in the preferences and the PHP home points to "/Applications/MAMP/bin/php/php5.5.3/bin". The PHP version is recognized and the debugger as well - it states "Xdebug 2.2.3 - komodo".
Clicking on the info button next to this, the PHP info is displayed:
PHP version: 5.5.3
bcmath, bz2, calendar, Core, ctype, curl, date, dom, ereg, exif, fileinfo, filter, ftp, gd, gettext, hash, iconv, imap, json, ldap, libxml, mbstring, mcrypt, mysql, mysqli, openssl, pcre, PDO, pdo_mysql, pdo_pgsql, pdo_sqlite, pgsql, Phar, posix, Reflection, session, SimpleXML, soap, sockets, SPL, sqlite3, standard, tokenizer, xdebug, xml, xmlreader, xmlwriter, xsl, yaz, Zend OPcache, zip, zlib
Nothing else is specified on the dialog.
In the IDE, I am able to set a breakpoint in the PHP script and I have created a debug configuration:
When I start this debugging configuration, Chrome is started, telling that "JetBrains IDE support is debugging this tab" and pointing to "file:///Applications/MAMP/htdocs/MobileTool/index.html" but it keeps waiting for localhost.