nginx 配备php环境
程序员文章站
2022-06-10 17:29:47
...
nginx 配置php环境:
nginx 配置php环境:
安装php php-fpm
cp /etc/php.ini /usr/local/php5.3.22/lib/
修改:/usr/local/php5.3.22/etc/php-fpm.conf
user = nobody
group = nobody
启动php-fpm
/usr/local/php5.3.22/sbin/php-fpm
查看是否启动了9000端口:
netstat -ntplu | grep 9000
配置nginx:
user nobody;
worker_processes 1;
server
{
listen 80;
server_name localhost;
location / {
root html;
index index.html index.htm index.php;
}
location ~ \.php$ {
root /usr/local/nginx/html/php;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /usr/local/nginx/html/php$fastcgi_script_name;
include fastcgi_params;
}
}
nginx 配置php环境:
安装php php-fpm
cp /etc/php.ini /usr/local/php5.3.22/lib/
修改:/usr/local/php5.3.22/etc/php-fpm.conf
user = nobody
group = nobody
启动php-fpm
/usr/local/php5.3.22/sbin/php-fpm
查看是否启动了9000端口:
netstat -ntplu | grep 9000
配置nginx:
user nobody;
worker_processes 1;
server
{
listen 80;
server_name localhost;
location / {
root html;
index index.html index.htm index.php;
}
location ~ \.php$ {
root /usr/local/nginx/html/php;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /usr/local/nginx/html/php$fastcgi_script_name;
include fastcgi_params;
}
}
相关文章
相关视频
推荐阅读
-
Ubuntu中搭建Nginx、PHP环境最简单的方法_PHP
-
Bae PHP环境怎么配置配置Mysql
-
搭建PHP开发环境
-
在Centos+nginx+wordpress环境停启动iptables 网站返回502
-
nginx的请求转发和php的header请求跳转原理是一样的吗?
-
felayman-----PHP环境搭建
-
Linux,Tengine,MariaDB,PHP生产环境一键安装包
-
在Mac OS上编译安装Nginx+PHP+MariaDB开发环境的教程,nginxmariadb_PHP教程
-
mac os nginx php mysql mac os mysql 启动 mac os 10.11 mysql mac os x 安装mysq
-
php linux 环境搭建