简体   繁体   中英

Get webserver configuration location from PHP extension in c++

I have created my own PHP extension in c++ and am using Centos7 - php 5.6 version. I wants to write the my extension debug log into the web server logging directory.We can get this from PHP by calling phpinfo() method.

在此处输入图片说明

from /etc/httpd location logs directory symbolic link with /var/log/httpd/在此处输入图片说明

How can we get this Apache configuration location from my PHP extension in c++?

Even if you were able to parse the web server's configuration file in PHP, you wouldn't be able to create your own log file. Worker processes in web servers usually don't have permissions to create new files in the system log directory.

If you need to print debugging messages, generate them with php_error() . They will be passed to the web server for error logging.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM