Speak now
Please Wait Image Converting Into Text...
Embark on a journey of knowledge! Take the quiz and earn valuable credits.
Challenge yourself and boost your learning! Start the quiz now to earn credits.
Unlock your potential! Begin the quiz, answer questions, and accumulate credits along the way.
General Tech Bugs & Fixes 2 years ago
Posted on 16 Aug 2022, this text provides information on Bugs & Fixes related to General Tech. Please note that while accuracy is prioritized, the data presented might not be entirely correct or up-to-date. This information is offered for general knowledge and informational purposes only, and should not be considered as a substitute for professional advice.
Turn Your Knowledge into Earnings.
I just did an upgrade of my server to Fedora 17 and merged some configuration files containing .rpmnew into the existing ones. I have been successfully logging my php errors in a separate log file by keeping the following in php.ini:
.rpmnew
php.ini
log_errors">errors = On error_log = /var/log/php-errors">errors.log
I am not sure why the errors are being logged to /var/log/httpd/error_log after the upgrade despite keeping the settings above.
/var/log/httpd/error_log
Also,
$ ls -l /var/log/php-errors">errors.log -rwxrwxr--. 1 apache myself 232 Dec 13 16:49 /var/log/php-errors">errors.log
shows that apache did own the php error log file.
What could be causing PHP errors">errors to be logged into apache error log file?
I think that here it's just the generic Apache errors that are seen in /var/log/httpd/error_log.
I would insert a call to error_log('test'); into some PHP logic that is known to get interpreted when some specific page is refreshed, and if that's not seen in /var/log/php-errors.log then I'd suspect that the versions upgraded to have some kind of a different config or permissions scheme that made the old config stop working.
error_log('test');
/var/log/php-errors.log
I'd recommend going through the 'Error handling and logging' section in /etc/php/php.ini, and checking for proper values for other directives. The directive error_reporting should be set to E_ALL or E_ALL & ~E_DEPRECATED & ~E_STRICT. The directive log_errors should be On.
/etc/php/php.ini
error_reporting
E_ALL
E_ALL & ~E_DEPRECATED & ~E_STRICT
log_errors
On
If just a filename (but no path) is specified for error_log, then the file will appear in the same directory as the PHP script that calls error_log(...).
error_log
error_log(...)
I'd also recommend specifying /tmp/php_error_log for error_log, refreshing the page, and then ls /tmp to see if the file is there.
/tmp/php_error_log
ls /tmp
If the file is not there, login as root, and do a search for the file name across the whole file system so see where it ended up.
Generally, the proper config to get PHP error log working in a particular directory changes across different versions of Apache, PHP, and various distros.
I can say that on Arch Linux with Apache 2.4, PHP 5.5.11 and systemd version 212-1 the config above will make the PHP error log end up somewhere similar to /tmp/systemd-private-65d4c3e3cc534155bcf3ec708c2362f6-httpd.service-h8MSsD/tmp/php_error_log.
/tmp/systemd-private-65d4c3e3cc534155bcf3ec708c2362f6-httpd.service-h8MSsD/tmp/php_error_log
No matter what stage you're at in your education or career, TuteeHub will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.
General Tech 9 Answers
General Tech 7 Answers
General Tech 3 Answers
General Tech 2 Answers
Ready to take your education and career to the next level? Register today and join our growing community of learners and professionals.