如何在Ubuntu 22.04安装PHP

最后发布时间:2023-10-30 13:20:50 浏览量:

https://www.myfreax.com/how-to-install-php-on-ubuntu-2204/

sudo apt install php-fpm php-mysql php-gd
sudo systemctl restart php-fpm
sudo systemctl status php-fpm
sudo vim /etc/nginx/sites-enabled/example.conf
server {

    server_name example.com;
    root /var/www/html/;
	index index.php index.html index.htm index.nginx-debian.html;
    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/run/php/php-fpm.sock;
    }
}
sudo vim /var/www/html/info.php
sudo chmod +x /var/www/html/info.php
<?php
phpinfo();

vim /etc/php/7.4/fpm/pool.d/www.conf

2023/09/03 20:41:07 [crit] 175836#175836: *73 connect() to unix:/run/php/php-fpm.sock failed (13: Permission denied) while connecting to upstream, client: 192.168.10.30, server: , request: "GET /info.php HTTP/1.1", upstream: "fastcgi://unix:/run/php/php-fpm.sock:", host: "192.168.10.178"

https://stackoverflow.com/questions/23443398/nginx-error-connect-to-php5-fpm-sock-failed-13-permission-denied

快捷入口
Linux 思维导图 浏览PDF 下载PDF
分享到:
标签
nginx