top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

How to debug the PHP component of Apache2?

+1 vote
804 views

My index.php file is compiled correctly when I use one of my PHP executables outside Apache, but fails when I ask Apache to serve it (and fails leaving a blank error log unfortunately). So I'm trying to understand how and where the two PHP compilations start behaving differently.

With my outside-Apache PHP executable, I only need to edit the php.ini file to use xdebug and get first-class debugging. I have no idea how to do the parallel analysis with Apache however. AFAIK, there is no PHP executable inside Apache, just a shared library likeat /libexec/apache2/libphp5.so, and I do not know how to debug that. Does Apache have a php.ini file also? My current system is Mac El Capitan by the way.

posted Apr 10, 2016 by Ahmed Patel

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button
You can turn on php error reporting and control the level in your php.ini (once you've identified the correct one with the information provided below).

Also, one of the php-specific lists may be a better focus for your php questions.

1 Answer

+1 vote

I don't think you understand exactly how php works. First of all , it doesn't compile anything , it's interpreting your script and outputs HTML.

Second , from your description of the problem it looks like you misconfigured something or your scripts are badly written , in any case you need to read the installation and configuration of php and php module for apache , if you need to check that you php module is installed correctly you cand put a file in the DocumentRoot of your website with the content of, for example info.php and load it in your browser. If you see the php info page then at least you know that the php module for apache is installed correctly. And go from there, You'll also see the location of the php.ini you need to edit in order to make changes to your php environment.

Anyway , every OS does things differently so i can't say for OS X how to configure the php module for apache but you should have found that information on the site where you got the packages that you installed.

http://php.net/manual/en/install.macosx.php

answer Apr 10, 2016 by Anderson
Similar Questions
+1 vote

How can we debug the Android framework Java code? i know how I can debug the c/c++ code with the help of GDB server etc, but I searched a lot on Google but did not get the solution, currently i am totally relying on Logs but I really need something to Debug the java code inside framework and etc?
please give me some pointers or some details about debugging AOSP framework java code?

+1 vote

I would like to improve the build speed of a large project. The opt build is compiled with -O2 -g. I noticed that without -g, compilation becomes faster, about 10-20%. The resulting binary has enough information to analyze crashes, except for the line numbers. Is there a way to include line number information but nothing else?

According to [http://gcc.gnu.org/onlinedocs/gcc/Debugging-Options.html], line numbers are produced only at level 2 (i.e. -g2 or the default of -g) or above. But according to [http://gcc.gnu.org/wiki/DebugFission], line numbers are only a fraction of the debug information (1%). So for me it would be best to have -g0 or -g1 but with line numbers. Is this possible?

...