Hello there -
I’m having a few issues I can’t seem to sort out - I was hoping someone could point me in the right direction. I’ve googled and searched these forums to no avail.
I have a droplet set up with a nice little LAMP stack, phpMyAdmin, Fail2Ban, etc. I added SSL today, and am currently running through the joys of doing that (which I won’t go into right now) - and found I needed Apache and PHP error logs. I had no problem setting up the directory/location of where to put the log files, and the apache logs seem to be working fine. However, the PHP log file I set up isn’t doing anything. I even purposely made PHP mistakes to test that the log was working, and it’s not. (I do see the PHP errors showing up in the apache log though - I’d rather keep them separated, if I can.)
I set up the PHP error log location in my php.ini file, and the phpinfo() test I have tells me that PHP is looking for the log where I placed it, however, nothing is getting written to the log file. So I’m wondering if I missed something along the line? (if it helps, I directed the log files to be placed in a /home/logs directory I created.)
And while I’m at it, I’d love to make the error logs just a bit more verbose. Is there any way to pull that off?
Thanks muchly :)
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.
The php.ini for PHP processes started by Apache is located at file
/etc/php5/apache2/php.ini
You can also change PHP setting in an.htaccess
file in the VitualHost’s root directory using the syntax:The integer value 32767 corresponds to
E_ALL
(For more info on constants see here.)For more info on the different log levels, check out: http://php.net/error-reporting
After spending the better part of the morning on this problem, here is what I learned…
If you want to put the error log file in a folder:
Note: Newer droplets will probably come with higher versions of PHP. So instead of “7.4” substitute “8.0” or whatever you’ve got.