Home >Backend Development >PHP Tutorial >Enable the php-fpm status function and access domain/status. The result is 404?

Enable the php-fpm status function and access domain/status. The result is 404?

WBOY
WBOYOriginal
2016-08-08 09:06:521356browse

1.nginx default configuration added

<code>location ~ ^/(status|ping)$
        {
                include snippets/fastcgi-php.conf;
                fastcgi_pass unix:/run/php/php5.6-fpm.sock;
        }</code>

2. Open pm.status = /status
3. Restart nginx and fpm, service nginx restart, service php-fpm restart

Visit: http://192.168.10.10/status
Result: 404

Reply content:

1.nginx default configuration added

<code>location ~ ^/(status|ping)$
        {
                include snippets/fastcgi-php.conf;
                fastcgi_pass unix:/run/php/php5.6-fpm.sock;
        }</code>

2. Open pm.status = /status
3. Restart nginx and fpm, service nginx restart, service php-fpm restart

Visit: http://192.168.10.10/status
Result: 404

<code>Nginx:
    location ~ ^/(status|ping)$ {
        include        fastcgi_params;
        fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_pass 127.0.0.1:9000;
        fastcgi_index  index.php;
    }</code>

I tried it, and accessing /status can output PHP-FPM work information normally.
Did you add an extra / after /status when accessing, then 404 will be returned.

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