Domanda

I am desperately searching for a nice IDE for PHP allowing me to debug. Therefore I am currently evaluating PHPStorm.

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.

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 Command ...  '--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'

Server API  Apache 2.0 Handler
Virtual Directory Support   disabled
Configuration File (php.ini) Path   /Applications/MAMP/bin/php/php5.5.3/conf
Loaded Configuration File   /Applications/MAMP/bin/php/php5.5.3/conf/php.ini

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/"

[OPcache]
zend_extension="/Applications/MAMP/bin/php/php5.5.3/lib/php/extensions/no-debug-non-zts-20121212/opcache.so"
  opcache.memory_consumption=128
 opcache.interned_strings_buffer=8
 opcache.max_accelerated_files=4000
 opcache.revalidate_freq=60
 opcache.fast_shutdown=1
 opcache.enable_cli=1

[xdebug]

zend_extension="/Applications/MAMP/bin/php/php5.5.3/bin/xdebug.so"

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

Loaded extensions: 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:

Section: JavaScript Debug URL: /Applications/MAMP/htdocs/MobileTool/index.html Browser: Chrome

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.

Please assist!

Thanks

È stato utile?

Soluzione

Sems you have created a configuration for javaScript debugging. But javascript debugger can't debug PHP. Please see http://devnet.jetbrains.com/thread/453183?tstart=0 for some hints

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top