I there
i have this domain.com
ponted to /home/username/public_html/domain.com
I added this lines to the .htaccess
To only get the path where PHP stores its logs, use:
pathinfo(ini_get('error_log'),PATHINFO_DIRNAME);
Which should return something like this (on localhost):
/Applications/MAMP/logs
An internal server error has often something to do with Apache and /var/log/httpd/ is the error log file of apache, so I think you are in the right file.
The error path is set in php.ini. To get the path use ini_get():
<?php
$errorPath = ini_get('error_log');
?>
I am not aware of such function but maybe phpinfo();
will have some info about that?
Log paths are defined inside apache site's configuration file, if you want a custom path to it if not by default all the logs are loaded into /var/log/apache2/*.log, so php have nothing to do with it
As i stumbled upon this problem and ini_get didnt help the following might be a solution for someone else too.
In case error_log is not set in php.ini or the like, the error is sent to the SAPI error logger. This, in case of e.g. apache2, is the error log defined in the apache vhost configuration. A way to get the apache log directory would be to check the symlink value of the stderr file descriptor.
An example which works on linux would be:
$logdir = pathinfo(realpath("/proc/".getmypid()."/fd/2"), PATHINFO_DIRNAME);
This example reads the path of the symlinked file of /proc/[PID]/fd/2 which is the stderr file descriptor.
Check for error_log
setting in php.ini
(or in phpinfo()
)