php, xampp and debug - can't get to work - php

I know this question has been asked before and I've looked through the responses but no matter what I do, I can't create an environment to step through my php programs.
I've downloaded the XAMPP stack, and Eclipse and enabled xdebug but nothing.
PHPinfo reports: Debug Build, No.
Does that mean that I'll never get an XAMPP installation to debug. If so is there another Windows, Apache, PHP, MySQL stack recommended?
I downloaded the Komodo IDE 21 day free trial and their wizard can't start debug either.
help

No, the Debug Build phpinfo() refers to is a compile-time switch/define that affects the way php itself is compiled. The debug build is less optimized, contains some more test code and the symbol files, used when stepping through the php C code with a debugger, are more accurate (mostly due to the less optimized code).
It does not affect the ability to add a script debugger module like xdebug. But you need a version of the module .dll/.so that is compatible with your version of php. The API version, Thread-safety "enabled/disabled" and "debug yes/no" information must match. (on second thought I'm not even sure if debug yes/no must match).
Does the xdebug section appear in the output of phpinfo()? If not make sure you've edited the right php.ini. In recent versions of xampp that should be <xampp dir>/php/php.ini regardless of whether you use php-cli or the apache module. But it used to be <xampp dir>/php/php.ini for the cli version but <xampp dir>/apache/bin/php.ini for the apache module of php.
Also check the error.log in <xampp dir>/apache/logs for error messages that might be related. Those should begin with "PHP Startup: ....error message..."

try using wamp if your using windows. It works great for me

Related

I Can't Get Xdebug To Be Installed On My Mac?

i have tried to install xdebug on my mac using home-brew everything seems alright, with no errors, but when i execute phpinfo method i don't find debug module there, i have tried million times with no success, so i have read an answer here in StackOverFlow for the same reason which suggests follow these instructions http://xdebug.org/wizard.php i have copied all code source of phpinfo page, and they gave me detailed instructions, i have followed there guide with no errors after restarting my server and refresh phpinfo page, and still no xdebug !!
php.ini - http://pastebin.com/RLyzXJ9z
phpinfo() code source - http://pastebin.com/H8XVX5GG
Based on your comments, the version of Xdebug isn't the one that matches the version of php running in either your Apache mod_php or your php-fpm (if you're on nginx).
I'm guessing if you used brew, your CLI php is really in /usr/local/something... and that matches the version for your xdebug. On the other hand you whatever PHP flavor you're using for your webserver to work with is different.
My vote would be to ditch the local php or brew installed version and use something like MAMP that runs 100% it's own libraries. Adding Xdebug to MAMP is pretty well documented if you google for it.

PHPStorm 7 don't find PHP Interpreter on Windows

I have installed trial version of PhpStorm 7 on my Windows 7 64 bit.
Php Storm is installed in "C:\Program Files (x86)\JetBrains\PhpStorm 7.0\bin\PhpStorm.exe" and my Xampp server in in E:\xampp.
I go to set php interpreter but PhpStorm don't find it.
I opened phpinterpreter windows and choose directory E:\xampp\php but I receive more error like this
Php Startup: Unable to load dynamic lybrary "\xampp\php\ext\php_xxxxxx.dll"......
It seems that PhpStorm 7 trunks the path excluding the disc and cannot find the installation of php over xampp directory.
I forced write correct value in C:\Users\currentuser\.WebIde70\config\options\php.xml , but I have same result
P
hp version: Not installed
Debugger: Not installed
but I have both installed and running.
What should I do to correct the problem?
Thanks very much
This worked for me, however I'm in PhpStorm 8 and the layout is entirely different. I'll still pop this here in case someone else needs these instructions.
Install your prefered PHP from here: http://windows.php.net/ (It doesn't need to be in your PATH, just pop it anywhere)
In PhpStorm, go to File -> Settings
In settings go to Languages & Frameworks -> PHP
Click the ellipsis next to Interpretter (this opens a new window)
Click the plus button in the top left and choose "Other Local"
Set the PHP exectuable to wherever you put your download above. It just needs to see php.exe
That's it. I've been using that to run Composer from PhpStorm... though I'm not convinced by the results.
As an alternative I would highly recommend using Vagrant for your PHP needs. You don't need PHP in Windows at all, and I've been developing this way for about 2 years. PhpStorm's remote support (including Vagrant, SSH and Remote Interpreter) is now excellent. I think the only thing I've been irritated by is PHPUnit Code Coverage is still broken.

IIS 7.5 PHP failure "The FastCGI process exited unexpectedly"

I've been attempting to get PHP working with IIS 7.5 and have hit a bit of a roadblock. Whenever I try to load the page I get the following error:
"HTTP Error 500.0 - Internal Server Error
C:\Program Files\PHP\php.exe - The FastCGI process exited unexpectedly"
Module FastCgiModule
Notification ExecuteRequestHandler
Handler PHP_via_FastCGI
Error Code 0x00000000
Requested URL *http://localhost:80/index.php
Physical Path C:\inetpub\wwwroot\index.php
Logon Method Anonymous
Logon User Anonymous
Failed Request Tracing Log Directory C:\inetpub\logs\FailedReqLogFiles
I've modified the PHP.ini file as required for use with IIS, and have also switched it to verbose mode. There isn't any log fiel in C:\inetpub\logs\FailedReqLogs, and none related to this error in the other log files generated.
I've tried the other fixes I've found here and elsewhere but nothing's been successful so far.
In some detail these were:
re-checking PHP.ini
Setting up fastCGI to work with PHP in IIS (configuring it to load the php.exe)
Trying WinCache as the execution method.
I had this problem when I upgraded PHP 5.4.14 to 5.5.3 (32-bit).
To fix it I had to install the Visual C++ Redistributable for Visual Studio 2012 Update 3
I found out that I needed this DLL by running php --version from the console when my web pages no longer loaded after the upgrade. Which then revealed that I needed the MSVCR110.dll, that comes with the 32-bit VS redistributable update from MS. Since I have optional updates turned off in Window Update, I did not get it automatically.
They also come in different flavors (32-bit, 64-bit, and ARM) 32-bit is what worked for me.
Install the 32 bit of Visual C++ Redistributable for Visual Studio 2012 Update 4
NOT the 64 bit
It seems that there are some dll extension in your php which are not work properly and force the CGI closed. Try to comment every extensions in php.ini file and see whether the error will exist or not.
[EDIT 1]
After some struggles I found out that the IIS is non thread safe web server and all the extension which you want to use in php for IIS should used nts lib for compiling. If the extension compile with thread safe library and add to IIS the IIS would not start. In this case your extension in thread safe(used in apache I guess) and should not add as an extension in IIS
Is this page you're trying to hit doing anything intensive?
I've had this problem before, and the error message was misleading.
You might want to try increasing your memory limit for that particular page. First find out the peak memory usage for that page:
echo memory_get_peak_usage(true);
Then set your memory limit appropriately:
ini_set("memory_limit","1024M");
Hope that helps!
I know its an old thread, but someone might save some headbashing.
In php.ini, changing
; Whether or not to enable the dl() function. The dl() function does NOT work
; properly in multithreaded servers, such as IIS or Zeus, and is automatically
; disabled on them.
; http://php.net/enable-dl
enable_dl = Off
to
; Whether or not to enable the dl() function. The dl() function does NOT work
; properly in multithreaded servers, such as IIS or Zeus, and is automatically
; disabled on them.
; http://php.net/enable-dl
;enable_dl = Off
Having enable_dl = Off doesn't work, commenting out the entire line does.
I had this problem when I was configuring PHP 5.4.17(32-bit).
To fix it I had to install the Visual C++ Redistributable for Visual Studio 2012 Update 4 and it worked fine after installing this update.
As mentioned correctly in above answers it's related to "Visual C++ Redistributable" that's not installed or not installed correctly.
Depending on my expertise on this issue.
1- First take care, each PHP version depends on specific Visual C++ Redistributable version (11,12,14,..)
so first is to check back your PHP version with the notes on the left side of php site:
PHP Download page
search for "Which version do I choose?" then see what version of VC++ is required to you.
2- YOU HAVE TO Download VC 32 and 64 BOTH. and check if your PC has it already so Unistall both of them (for the same version only).
and then install 32 first and 64 after. (no need for any restarts unless it asks).
3- Complete the php installation other steps for iis, apache or ....
I hope it helps you.
if you have two application like (your app, phpmyadmin) just disable APC extension
Hope that fix the issue
it's worked with me
if not just install Microsoft visual C ++ 86 and 64
I have the same problem, which I fixed by installing the 32 bit of Visual C++, redistributable for Visual Studio 2012. 64 bit doesn't work for me.
This may be because required libraries are not available. Run the php-cgi.exe from a command prompt and see if it executes successfully. It should output some HTML if it is working. I was getting a general 0xFFFFFFFF error code - which is not very helpful.
If it instead returns an error, resolve this before continuing.
I had installed the Visual C++ runtimes as indicated, but the minor version was older than the one used to compile the executable and it failed on starting.
After applying a later version of the same runtime, the program ran normally.
Many of the other suggestions talk about this, but fail to provide a simple test. See The FastCGI process exited unexpectedly for a similar question.

Xdebug crashes apache

My Xdebug works fine when I use eclipses' internal browser but when I use it in an external browser apache crashes.
I am using xampp and on windows 7 64 bit. If someone needs more information let me know.
For some reason if I have the variables tab open in the php debugger in eclipse it crashes apache. So to stop it I just can't have variables tab open while debugging. So this avoids the problem but doesn't fix it. I would like to be able to have this tab. Any suggestions?
It is possible that the XDebug build and type does not match your apache & php build and type...
Apache compiled with VS.NET 2008 (VC9) for 32bit and using PHP as a module would require XDebug: 32bit, VC9, Thread Safe.
http://xdebug.org/download.php
Also, you could test another WAMP package that comes with XDebug (for example WampDeveloper) and if it also does not work for you, it's probably not a build mismatch issue.
Hey I got this working
Eclipse 3.6.1 (because on later versions key shortcut for putting line comment don't work)
Xampp 1.7.4
Xdebug 2.1.2
The trick is to change php from VC6 to VC9 and then it just works correctly.
BTW. It's the variables panel that causes xdebug to crash apache on php VC6.
Remember to get VC9 version of xdebug for new php AND if you put your new php in directory other than
\xampp\php, then on phpinfo(); you'll see that there's no php.ini loaded so just rename old php (co you can swich them from one to other anytime) and put new php in the same directory in which original php was in "\xampp\php" and copy your php.ini (because paths doesn't change). Also remember to obtain any additional php extensions you've been using in VC9 version for new php and put them in "\xampp\php\ext"
I can confirm most of what t0meck said. Except I've moved up to xampp-win32-1.7.7-VC9 which has PHP 5.38. Taking the phpinfo() results from that to Xdebug's custom installation analyzer, it specifies the php_xdebug-2.1.2-5.3-vc9.dll, but the problem isn't entirely eliminated. As I've documented in my 'notes to self' page, the following is working for me.
After following the above procedure, the 'run as' should work on the first try, but the 'debug as' may crash Apache at every attempt. This is an issue that has driven many people to severe distraction. There is an apparent bug exposed using the debug perspective. At the top center of the perspective is a window with two tabs, the variable view and the breakpoint view. Usually, Apache crashes only when the variable view is highlighted, so highlight the breakpoint view instead. Then set a breakpoint on your project. Now, if you are one of the chosen, you will be able to step through the script using the debugger, but when you switch to the variable view it may still crash Apache. What a drag. Repeat the process and the next time you should actually see the variables and the problem will magically go away, until you restart the project. Just repeat the procedure and be satisfied with being one of the lucky ones.
Don't know if this help, I have same kind of issue, but it relate to array depth xdebug >handle in Variables view. And you can change it. Widnow > Preferences > PHP > Debug > >Installed Debug > Xdebug > Configure enlarge the "Max array depth" solved my issue.
http://bugs.xdebug.org/view.php?id=658#c1767
Just set it to 10 or bigger and it should work

Using inclued php pecl extension

I'm currently trying to level up on my PHP debugging skills and as part of that I'm trying to learn several new tools. One of them is inclued.
The extension seemingly works fine (no startup error, shows up in phpinfo, generates dump files), but it always reports number of includes as 0, so something is clearly not working right.
At first I suspected this was related to my heavy use of auto_include, but after doing some tests which do not, I doubt that is related.
Class graphs are generated OK, but include maps simply don't exist. Am I simply Doing It Wrong, or is the extension broken? I just don't know and even after some heavy duty googling cannot find anything useful.
I installed inclued using the "phpize method". My PHP version is 5.3.2 running on Mac OSX 10.6.5. I also have XDebug and memtrack installed.
After doing a test run with valgrind watching Apache I noticed xdebug was operating below inclued. On a blind test I tried disabling XDebug and lo and behold: inclued works as expected.
So to answer my own question:
Don't use XDebug in conjunction with inclued if you want to have include graphs. Class graphing works fine with XDebug running.

Categories