Home>Article>Backend Development> What should I do if phpphpinfo cannot be accessed?

What should I do if phpphpinfo cannot be accessed?

青灯夜游
青灯夜游 Original
2020-09-29 10:47:32 3370browse

Solution: First confirm that php-fpm has been started and the service port is normal; then modify the "*.conf" file under "/usr/local/tengine/conf/vhost"; finally php-fpm.conf In the file, set "listen=127.0.0.1:9000".

What should I do if phpphpinfo cannot be accessed?

Recommendation: "PHP Video Tutorial"

Debugging the lnmp environment today, the following appears Report an error. Unable to query php information.

What should I do if phpphpinfo cannot be accessed?

Environment: Linux version CentOS Linux release 7.3.1611 (Core), nginx uses tengine. Both php and tengine are installed from source code to /usr/local.

First confirm that tengine has been started, and write a static test web page in the root directory of the website. The test is OK and can be displayed normally.

Confirm that php-fpm has been started and the query service port is normal. I suspect that tengine's PHP support is not configured. Open the *.conf host configuration under /usr/local/tengine/conf/vhost and modify the following configuration: add index.php to make the nginx server support index.php as the homepage by default, and enable related configurations through comments.

Note that the location of $document_root can be written as $document_root or the root directory of the website, but it must not be the default /scripts.

location / { root /var/www/html; index index.html index.htm index.php; } ... ... location ~ \.php$ { root /var/www/html; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } ... ...

At the same time, ensure the configuration of /usr/local/php/etc/php-fpm.conf:

listen = 127.0.0.1:9000

Then, just restart the service.

What should I do if phpphpinfo cannot be accessed?

Related recommendations:php training

The above is the detailed content of What should I do if phpphpinfo cannot be accessed?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn