I cannot debug a PHP script as a script. It always terminates immediately after starting. I set up an Xdebug log in my php.ini, but it's completely unhelpful. Xdebug does show up on my phpinfo(), so I know it's loaded in Apache.
I can also debug code as a webpage (which provides no info on variables and will not stop on breakpoints though), so I know Eclipse has the proper server settings. Both debug options use the same PHP exe (the one installed with XAMPP, php 5.3.1 compiled with vc6 compiler). I made sure that the compilation of Xdebug matched these settings.
On a perhaps related note: I noticed that I could only load Xdebug with the zend_extension command, instead of zend_extension_ts even though my version of PHP is indeed thread safe? I have to admit I'm a little confused by that.
I also made very sure that wherever I could select "XDebug" in Eclipse, I did. I've followed two tutorials to no avail here. Anyone have any ideas? I've tried the version of Xdebug bundled with my XAMPP (2.0.6-dev) and I also downloaded a new .dll, version 2.1.
Thanks!
Excellent instructions for Setup XDebug on XAMPP and Eclipse
#user629300 Instructions are good for eclipse versions prior to 3.5 see the links to get instructions for version based instructions. Also Getting XDebug to work with apache xampp to debug php, has pictures with good explanations. They are a little stale though.
A summary of the details from the first link, assuming PHP > 5.3 (which hopefully everyone is running now!):
Make sure that your php.ini file contains the following:
[XDebug]
zend_extension={xampp-folder}\php\ext\php_xdebug.dll
xdebug.remote_enable=1
xdebug.remote_host="localhost"
xdebug.remote_port=9000
xdebug.remote_handler="dbgp"
Remove any config entries under the [Zend] heading, particularly those starting with zend_extension
Configure Eclipse:
in Window -> Preferences -> PHP -> Servers, configure the PHP server to use XDebug, add the base URL and local web root
in -> Installed debuggers, configure XDebug to accept remote sessions
(optional?) configure the PHP executable to point to php.exe in your XAMPP installation
You should now be able to hit breakpoints in Eclipse by adding XDEBUG_SESSION_START to the query string of your URL, e.g. http://localhost/?XDEBUG_SESSION_START.
first download the dll for xDebug
then edit your php.ini file
zend_extension_ts = “C:\xampp\php\zendOptimizer\lib\ZendExtensionManager.dll”
make sure the line is uncommented
restart apache
make sure you are editing the right php.ini file
Related
I am getting environment variable PATH error from wamp server.
already set the path (C:\wamp64\bin\php\php7.2.10) in advance system settings but again getting the same error
Sorry,
There is an error.
There is Wampserver path (c:/wamp64)
into Windows PATH environnement variable: (C:\wamp64\bin\php\php7.2.10)
It seems that a PHP installation is declared in the environment variable PATH
C:\wamp64\bin\php\php7.2.10
Wampserver does not use, modify or require the PATH environment variable.
Using a PATH on Wampserver or PHP version
is detrimental to the proper functioning of Wampserver.
Press ENTER to continue...
see the picture below:
how to resolve wamp server (path) error
The error is telling you that you have set the windows path to contain a folder to a version of PHP. WAMPServer does not need and does not like to have the PATH set to any version of PHP whether it came with WAMPServer or was installed some other way. It is all in the message on the Command Window.
So to remove the error, remove all references to any PHP you may have anywhere on your system from your PATH environment variable, regardless of whether it came with WAMPServer or was installed some other way.
The reason of course is that with WAMPServer you can have many versions of PHP installed into WAMPServer. If you notice it comes out of the box now with more than one version of PHP ready to go.
The Reason
If you add ONE of those PHP versions to the PATH, then when you switch to another version of PHP your PATH would still be pointing to the old version. You will undoubtedly forget to amend the PATH, and this will just cause confusion and issues, so we prefer you not to have any version of PHP on the path at all.
The PHP CLI
Ok so now you have no version of PHP on your path how will you run the PHP CLI (Command Line Interface) I hear you ask :)
To do this I have a little .bat/.cmd file that I place in a folder that is already on the Windows PATH so I can run it form anywhere.
I have already written that up in this answer to a previous question, so follow this link rather than me writing it all up in 2 places.
I'm a beginner at Java EE. Please advise me which is the good Wildfly verson for Eclipse Mars and Windows10? Thanks for help
Hi follow the simple steps below, there is no problem at all with any version on windows, 8 works well, 9 or even 10.
Make sure you have java properly installed on your machine, for example if you open a Command prompt and press 'java -version' you get something back.
Download the latest version of wildfly from here as a zip.
Unzip the file and you have the app server folder. Go to the /bin folder and try to start the app server using the /bin/standalone.bat (does it start? is it booting?). If yes stop it by pressing Ctrl +C.
Once you make sure the above steps work, then you can go to your eclipse and add the Application server, installation, to your list of servers for example see here for specific details .
To cut a long story short, wildfly is the easiest app server to install, it is just a zip, you unzip it and if you have setup java properly on your machine it justs runs - no installers not a big deal actually :)
Hope that helps.
PHP Startup: unable to load dynamic library
'C:\xampp\php\ext\php_memcached.dll' -%1 is not a valid Win32
application.
This error is keep showing whenever I restart Apache Server(Using xampp).
I have installed memcached and started using command prompt, memcached.exe -d start and its running fine as I checked task manager.
Now, How to fix it? Am I not using right .dll file?
Try phpinfo() and check right on top, where it says Compiler, if you downloaded the correct VC8/9/10 32/64bit version of the .dll, exchange it - if needed - restart apache and you should be fine. Sometimes this can be a bit tedious to find the corresponding .dll's, good luck!
yes. regardless windows 64, 86 version nor non-thread safe version or other. Try all version to figure out if what version is suite for your xampp.
MAC OSX 10.7.5 -- MAMP 2.1.3 -- XDEBUG 2.2.3
I used the xdebug wizzard to download and install using the terminal. After following the steps
Rebooted MAMP but no xdebug in phpinfo();
I thought it was weird that the wizzard says all you have to do it paste zend_extension = /Applications/MAMP/bin/php/php5.4.10/lib/php/extensions/no-debug-non-zts-20100525/xdebug.so in the end of your php.ini file
I did add quotes around the pathname - the pathname from the wizzard came without them
Every other tutorial says there is more than just this one line that needs to be added
MAMP seems to have its own 'zend_extension = "/Applications/MAMP/bin/php/php5.4.10/lib/php/extensions/no-debug-non-zts-20100525/xdebug.so"' that just needs to becommented out. Anyway I tried both the pasting from the wizzard as well as uncommenting.
Since I'm trying to use xdebug with my PHPstorm trial, I checked for the steps layed you at http://www.dotvoid.com/2012/09/using-xdebug-in-mamp/
Again it's weird: Here it says that all you need to do it add these 2 lines
xdebug.remote_host=127.0.0.1
xdebug.remote_enable = 1
It's weird because other tutorials make you add more lines (back when I tried to get xdebug on an older version of MAMP to go with netbeans without success) about the localhost.
Here's what's in my php.ini file now:
[xdebug]
zend_extension= "/Applications/MAMP/bin/php/php5.4.10/lib/php/extensions/no-debug-non-zts-20100525/xdebug.so"
xdebug.default_enable=1
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.remote_autostart=1
I also checked if I'm configuring the right php.ini file, looking in phpinfo(); where it says which php.ini file is loaded. In this case /Applications/MAMP/bin/php/php5.4.10/conf/php.ini I verified if this is the correct php.ini file that I'm edititing and it is.
The last anwser in this SO question here speaks of two certain files that need to be the same binary maybe one file is 32bit binary and the other one is 64bit. When I tried to check this, the files mentioned in that question (/path/to/mamp/Library/modules/php5.3/libphp5.so) are not in my current installation of MAMP. In my current installation, I can go to Applications/MAMP/Library/modules, but there is no folder in that modules folder, leave alone one that says php of any sort.
In this tutorial, there is a mention of updating PEARL. This may not be relevant to my issue but I just followed it because I don't know really, I thought it wouldn't hurt. When I try to do that in my terminal the error message says
Xdebug requires Zend Engine API version 220090626.
The Zend Engine API version 220100525 which is installed, is newer.
Contact Derick Rethans at http://xdebug.org/docs/faq#api for a later version of Xdebug.
I found this issue in the xdebug FAQ. I quote
it is most likely because you compiled Xdebug against PHP headers that belong to a different PHP version that you're running
Further explanation confirms that the message about the zend api version points to the same issue and that two versions of PHP are colliding somehow.
The solution to this is explained on the same FAQ page where it says
Q: How do I find which phpize to use? [...]If it doesn't match up, and perhaps the wrong "phpize" binary is found on the path, you can
run configure as follows:
1. /full/path/to/php/bin/phpize
2. ./configure --with-php-config=/full/path/to/php/bin/php-config
I don't know how to interpret this in practice. But here's what I have tried
I was still in the /usr/bin and tried the first command usr/bin/phize. this returned Cannot find config.m4. Make sure that you run '/usr/bin/phpize' in the top level source directory of the module
I don't know what they mean by the top level source directory of the module. Maybe 1. and 2. are 1 command? And the module means xdebug.so?
No matter what I try though, I keep getting the Cannot find config.m4 error whenever I just even try to run phpize. I tried running phpize from /usr/bin/phpize or from /Applications/MAMP/bin/php/php5.4.10/bin/phpize. Same error came
I like to debug my PHP applications. So, I installed the ZendDebugger.
I downloaded and placed the ZendDebugger.so file in
/usr/lib/php5/modules/ZendDebugger.so
And pasted this code in the php.ini file:
zend_extension=/usr/lib/php5/modules/ZendDebugger.so
This path is correct, and I have tried several other paths.
I also have tried other codes in the php.ini file.
I work with a Ubuntu server and eclipse with the PDT extension on Ubuntu.
But the debugger is not installed. The only information I can find in the phpinfo is:
This program makes use of the Zend Scripting Language Engine:
Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies
I don't know what to do? I have searched many times on the internet, and tied it with a clean server install.