Error - No PHP Executables defined
I am running Eclipse on OS X 10.6 with MAMP 1.9
Everything was working fine before. I created a new PHP file and now none of my files will run.
I reset my Eclipse Preferences - PHP Executables, to point to MAMP/bin/PHP5.3/bin
Then I got a lauch error - "The Session Could Not Be Started, in order to generate debug information, please makw sure that the debugger is properly configured as a php.ini directive."
A PHP Web Page launch opens a URL at a running server (usually your local server).
A PHP Script launch uses the CLI/CGI executable that you defined in your preferences.
It also uses the php.ini defined there, and from what I remember, it will try to locate the one next to the executable by default.
Sounds like the php.ini was not defined/located. Check that you have the ini in the directory you selected.
This ini should also have the right debugger directives and paths needed for the CLI/CGI debug session.
hope that helps
The problem was in my MAMP php.ini ( /Applications/MAMP/conf/php5.3 ). It turns out I needed to remove the ";" semi-colon from the beginning of the line with the path to xdebug.so.
Incorrect:
[xdebug]
;zend_extension="/Applications/MAMP/bin/php5.3/lib/php/extensions/no-debug-non-zts-20090626/xdebug.so"
Correct:
[xdebug]
zend_extension="/Applications/MAMP/bin/php5.3/lib/php/extensions/no-debug-non-zts-20090626/xdebug.so"
My MAMP php.ini file does not include a directive for the Zend Debugger. The above setting is for XDebug in the MAMP PHP 5.3 php.ini file. I did not have any directives for the Zend Debugger in my php.ini file. I may have removed them when I initially set this up over a year ago, then again maybe the Zend Debugger is not inlcuded with the MAMP installation. I would welcome confirmation on this and of course any additional insights are appreciated.
I have included some resources below for those experiencing problems with XDebug, Zend Debugger, MAMP, and Eclipse PDT setup and configuration:
This is the thread that helped me identify the problem, as well as instructions on how to confirm that Xdebug is running:
http://forum.mamp.info/viewtopic.php?f=6&t=9119&p=23143&hilit=eclipse+debug#p23143
This is from NetBeans Support, it is relevant and I think a good reference to bookmark:
http://netbeans.org/kb/docs/php/configure-php-environment-mac-os.html
I also found this documentation from DeveloperWorks to be helpful, particularly p.17 - 21 and p.30
PDF:
www.ibm.com/developerworks/opensource/tutorials/os-php-eclipse-pdt-debug/os-php-eclipse-pdt-debug-pdf.pdf
URL:
www.ibm.com/developerworks/opensource/tutorials/os-php-eclipse-pdt-debug/section4.html
Related
I have multiple versions of PHP installed as per this guide, that I wrote.
Basically, it is an ApacheLounge installation talking to PHP via FastCGI on Windows 10.
This used to let me run these PHP versions at the same time on different VirtualHosts. Apache calls the proper PHP version via FastCGI on these ports:
PHP 5.2.17 on port 9052
PHP 5.3.29 on port 9053
PHP 5.4.45 on port 9054
PHP 5.5.38 on port 9055
PHP 5.6.40 on port 9056
PHP 7.0.33 on port 9070
PHP 7.1.33 on port 9071
PHP 7.2.31 on port 9072
PHP 7.3.19 on port 9073
PHP 7.4.7 on port 9074
Everything Some of these had been working for a while after the installation. Yesterday I had to test a website on PHP 5.6, but the ouput was just a "No input file specified message" which, turns out, is not that much descriptive, as a quick google search confirmed.
So I started a systematic approach.
I created a VirtualHost for every PHP version, with just a index.php file with an echo statement.
I tested all PHP versions installed, and all PHP5 versions did not work, while PHP7 versions worked as usual.
I removed all custom configuration files. No change.
I served a simple index.html file, and that works on all VirtualHosts. About PHP, no change.
I thought it was PHP 5.x bug, but after I rebooted my PC, the PHP 5.2 version started working.
I stopped, removed and reinstalled some of the Windows Services create via NSSM, with no change.
This is what I think I know:
it is not a PHP 5.x issue, because PHP 5.2 works;
it is not a FastCGI problem, because all VirtualHosts have the same configuration, except for the port number;
it is not an Apache configuration problem, because it starts and stops and reboots and serves;
it is not a PHP configuration problem, beacuse all configuration is standard;
it is not a .htaccess configuration problem, because there are no .htaccess files;
Any idea about how to debug this configuration, or about what is going wrong is appreciated.
Thank you.
This answer is about what I discovered above the issue, and how it is working for me.
On this post and elsewhere on the net I found the advice to leave the doc_root in php.ini commented out:
;doc_root =
That works, in fact that's the configuration I use for all the abovementioned PHP 7.x installations, and for PHP 5.2 too. However, thats does not work for PHP 5.3 to 5.6.
Reality is, for those versions of PHP, Apache's DocumentRoot and PHP's doc_root directives must match exactly.
It was not easy to get here, due to the amount of deceiving or plain wrong information I found on the web (mostly due to PHP changing behavior from version to version):
this (unsolved) bug report with a similar issue has a user comment that advises to leave doc_root commented out;
this paragraph is contradictory;
PHP's documentation is wrong for those particular versions, correct for the current ones:
on Description of core php.ini directives:
Name Default Changeable
doc_root NULL PHP_INI_SYSTEM
and on Where a configuration setting may be set:
PHP_INI_SYSTEM Entry can be set in php.ini or httpd.conf
I hope this information is useful.
NOTE:
It took me a lot of time to solve this issue. One technique that I found useful is to increase Apache log level to trace8, as suggested here:
LogLevel trace8
I'm trying to edit my php.ini file to turn off short tags. Pretty standard.
phpinfo() tells me I am running PHP Version 5.6.10
I have edited 2 php.ini files so far, and neither has taken effect (yes, I restarted MAMP)
MAMP/conf/php5.6.10/php.ini
MAMP/bin/php/php5.6.10/conf/php.ini
Neither file changes the status of short tags
Can anyone direct me where/how to change my php.ini settings?
I really freaking miss WAMP. Whose bright idea was it to buy a Mac?!?
When you run phpinfo() you need to look for the value Loaded Configuration File. This tells you which php.ini file PHP is using in the context of the web server.
Aaannnnnnnnddddd I was being a dufus
I had been commenting the line out instead of changing to "Off"
as you version is 5.6.10, and supposed your apache2 server runing on ubuntu.
php.ini dir is
/etc/php5/apache2/php.ini
On my Mac, running MAMP I have a few locations that would contain the likely php.ini
So I edited the memory_limit to different values in the 2 suspected files,
to test which one effected the actual MAMP PHP INFO page details.
By doing that I was able to determine that this was the correct php.ini:
/Applications/MAMP/bin/php/php7.2.10/conf/php.ini
Right i'm pulling my hair out on this one.
I'm using Netbeans, EasyPHP, and Installed xdebug using by copy/pasting my phpinfo() results into the xdebug wizard which then tells you which .dll file you need to download.
Well i've followed all the instructions, my phpinfo() now says xdebug is installed, I've added the appropiate lines in my php.ini file. However, my breakpoints in Netbeans do not work! I know that xdebug is installed because if I manually add xdebug_break() to my code then they act as a breakpoint.
How can I get netbeans and breakpoints to work without manually using the xdebug php function everytime ?!
PS. I know this question has been asked a million times but I've followed the other solutions and none have fixed my problem!
I'm using XP if that shines any light on the matter?
After many painful hours, I have found out that I had both:
extension = php_xdebug.dll
uncommented in my php.ini file and:
zend_extension = C:\path-to-xdebug-file\php_xdebug.dll
added in my php.ini file. You're supposed to have one or the other!
Anyway I changed
extension = php_xdebug.dll
to
;extension = php_xdebug.dll
Installed MAMP on a new Macbook with PHP 5.5.3.
Reload and refresh do nothing. Still nothing. Google around for a few minutes trying to find out what is wrong, come back and refresh. It works. What the heck?
I went into php.ini and disabled all the new OPcache and set the default cache time to 0. Added headers to the document to force no caching. Still same problem. What the heck is going on here?
The network tab is showing a HTTP 200 request, so any new HTML in the index.php file renders fine, but new PHP that needs to be rendered by the server is delayed and not rendered until some predetermined set of time passes that I don't know how to change. What's going on?
I checked this in Safari too so it is definitely a server thing that is keeping the file from rendering.
Interesting fact though, if I go into MAMP and change the PHP version to the old one (PHP 5.2 or something) it will render normally, with no "caching issues". Switch to PHP 5.5 and it hangs up. In the MAMP preferences caching options for 5.5 don't even exist and are automatically disabled.
Disable OPCache
MAMP now turns on OPCache by default, you can disable it by editing your php.ini file. Make sure you edit the correct php.ini.
I was running into the same problem myself. MAMP with PHP version 5.5.3 runs OPcache by default, but you can't turn it off in the GUI like you can with the older PHP version 5.2.17. You have to manually comment out all the OPcache lines at the end of the php.ini file (MAMP/bin/php/[version]/conf/php.ini) and make sure to stop and start the servers for the changes to take effect.
I updated the URI, the changes can be reflective by also changing /conf/ under the php folder, but it seems MAMP will ignore these after restart.
I added opcache_reset(); in my main PHP to stop this caching.
Removing it from php5.5.3/conf/php.ini did nothing for me.
Edit
Turns out there also is a /Applications/MAMP/bin/php/php5.5.3/conf/php.ini. It
works if I comment it out there.
1) in /Applications/MAMP/bin/php/php5.5.3/conf/php.ini
2) set opcache.revalidate_freq=0
3) restart MAMP
Took me so long to figure out it was a MAMP problem! Why would OPcache be enabled by default-- and require php.ini tinkering to disable-- in an app that's supposed to be used for testing websites? Anyway, I read through this whole thread and tried the various solutions.
Here are my notes on how each solution works and considerations for selecting a solution.
Each solution works on its own; no need for redundancy.
Webpage code solution
opcache_reset();
<?php opcache_reset(); ?>
Must be added in the webpage code.
Forces all scripts to be reloaded.
Works without restarting MAMP server.
Server configuration solutions
Important: Use the php.ini file in /Applications/MAMP/bin/php/php5.5.3/conf/php.ini and not in
/Applications/MAMP/conf/php5.5.3/php.ini. Adjust accordingly if you're using a different version of PHP.
enable=0
[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
enable=0
Must be added under [OPcache] in php.ini.
Disables OPcache.
Requires MAMP server restart.
opcache.revalidate_freq=0
[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=0
opcache.fast_shutdown=1
opcache.enable_cli=1
Modify opcache.revalidate_freq under [OPcache] in php.ini.
Makes OPcache check for updates every 0 seconds instead of every 60 seconds.
Requires MAMP server restart.
Commenting out [OPcache]
;[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
Comment out the entire [OPcache] section in php.ini.
Removes OPcache from the PHP server.
Requires MAMP server restart.
Considerations
Choose the webpage code solution if:
You just need to force script refreshing for a particular project
You don't want to restart the MAMP server
You don't want to edit php.ini
Choose a server configuration solution if:
You want to disable caching by default instead of having to do it in every project
You're comfortable with editing php.ini
I personally prefer enable=0 since it's the simplest solution for me, and I need caching disabled by default.
References
http://php.net/manual/en/function.opcache-reset.php
http://php.net/manual/en/opcache.configuration.php
It looks like this is finally a GUI option. MAMP 3.0.7.2 for Mac OS X.
It was painful spending around 1 hour trying to figure out what could it be.
I just added this at the end of the code and restart MAMP.
opcache.revalidate_freq=0
opcache_reset();
Edit "/Applications/MAMP/conf/php5.5.3/php.ini", and search for [OPcache] and add this code under it directly:
opcache.enable=0
This will disable opcache in when use PHP in MAMP server.
Oh man am I glad I found this thread! I was pulling my hair out! I just upgraded MAMP yesterday and didn't notice this caching issue until today while working on a project. Thought I was losing my mind.
I just changed "/Applications/MAMP/conf/php5.5.3/php.ini" very bottom of file opcache.enable=0
This is also current in the Windows version of MAMP as well.
C:\MAMP\conf\php5.6.3\php.ini
It's listed at the very bottom of the file.
The other problem I found, was on a QNAP NAS TS-431. This caching is also enabled, and if you are working with dynamically changing files, or try to develop on it, you'll be ripping out your hair. As per the other comments, just comment it out. The setting is located in:
Control Panel/Applications/Web Server/PHP.ini Maintenance.
Once again, you'll find the settings at the bottom of the file.
For those using MAMP 6.x you have to disable the setting in the UI otherwise MAMP will overwrite your PHP files the next time you restart apache.
The setting is in the PHP setting as shown here:
Change the default OPcache setting to off and click Save. After saving restart the Apache service.
Open your Mamp panel
on the right top corner click "Preferences"
a pop will open ,there is a option to "off" the php cache.
It works like charm,No need to modify any other files.
I am trying to set up xdebug to work properly with my Komodo IDE. I am running a Magento site and can't find the proper php.ini file to add the configuration information to. I ran a phpinfo command and checked the location and it was on usr/local/lib/php.ini. When I did research to find where that file was located everything I read said to stay away from that file.
Also where is that file located? Is it in the public_html?
I suggest you to use NetBeans ( it is very easy to configure with Xdebug ).
you should add these lines in your php.ini:
zend_extension=/usr/lib/php5/20100525+lfs/xdebug.so
xdebug.remote_enable=on
xdebug.remote_handler=dbgp
xdebug.remote_host=localhost
xdebug.remote_port=9000
display_errors = 1
Check the path /usr/lib/php5/20100525+lfs/xdebug.so and use your one.
To have a better experience with Xdebug, I suggest you to use one of those 2 plugin for your browser:
easy Xdebug for Firefox -> https://addons.mozilla.org/en-us/firefox/addon/easy-xdebug/
Xdebug helper for Chrome -> https://chrome.google.com/webstore/detail/xdebug-helper/eadndfjplgieldjbigjakmdgkmoaaaoc
Yes, that's the file you'll need to edit to both enable, and configure xDebug. People are warning you away from that file because editing php.ini isn't something a novice should take on. However, configuring xDebug isn't something a novice should take on either.
So long as you backup the file and edit only your local copy, you should be good to go.