九溪

溪水润知林,滴露启慧心

用户工具

站点工具


wiki:linux:ubuntu-install-nginx-php-mysql

差别

这里会显示出您选择的修订版和当前版本之间的差别。

到此差别页面的链接

两侧同时换到之前的修订记录前一修订版
后一修订版
前一修订版
wiki:linux:ubuntu-install-nginx-php-mysql [2019/10/05 17:33] colinwiki:linux:ubuntu-install-nginx-php-mysql [2023/01/03 15:25] (当前版本) – 外部编辑 127.0.0.1
行 14: 行 14:
   sudo apt-get install nginx   sudo apt-get install nginx
  
-查看Nginx版本 +参考 
-  nginx -+  * [[.ubuntu-install-nginx]]
-Nginx文件语法检测 +
-  nginx -+
-Nginx的服务控制操作 +
-  sudo systemctl status nginx +
-  sudo systemctl start nginx +
-  sudo systemctl stop nginx +
-  sudo systemctl restart nginx+
  
-==== 一些网站的配置 ====+==== 关于php网站的配置 ====
  
 DokuWiki网站的Nginx配置 DokuWiki网站的Nginx配置
行 34: 行 27:
 以 vim /etc/nginx/sites-available/default 为例 以 vim /etc/nginx/sites-available/default 为例
 <code xml> <code xml>
-        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 +# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 
-        +
-        location ~ \.php$ { +location ~ \.php$ { 
-                include snippets/fastcgi-php.conf; +        include snippets/fastcgi-php.conf; 
-        +
-        #       # With php7.0-cgi alone: +#       # With php7.0-cgi alone: 
-        #       fastcgi_pass 127.0.0.1:9000; +#       fastcgi_pass 127.0.0.1:9000; 
-        #       # With php7.0-fpm: +#       # With php7.0-fpm: 
-                fastcgi_pass unix:/run/php/php7.0-fpm.sock; +        fastcgi_pass unix:/run/php/php7.0-fpm.sock; 
-        }+}
 </code> </code>
 注意:fastcgi_pass中的php版本应与当前安装的版本一致 注意:fastcgi_pass中的php版本应与当前安装的版本一致
  
-==== 一些关于Nginx的问题 ==== 
- 
-出现类似 nginx depends on nginx-core (>= 1.10.3-0ubuntu0.16.04.4) 的错误的解决办法: 
- 
-首先看是否有 Apache2 服务正在启动,关闭它 
- 
-  sudo systemctl stop apache2.service 
- 
-防止 Apache2 服务自启 
- 
-  sudo systemctl disable apache2.service 
- 
-重新安装 Nginx 
- 
-  sudo apt-get install nginx 
- 
-参考 
-  * [[.ubuntu-install-nginx]] 
  
 ===== 安装 PHP ===== ===== 安装 PHP =====
行 88: 行 63:
   sudo systemctl status php7.0-fpm   sudo systemctl status php7.0-fpm
      
-==== 安装php模块 ==== +==== 查询、安装php的可选模块 ==== 
  
 查询可用模块 查询可用模块
行 94: 行 69:
      
 安装模块 安装模块
-  apt-get -y install php7.0-mysql php7.0-curl php7.0-gd php7.0-intl php-pear php-imagick php7.0-imap php7.0-mcrypt php-memcache  php7.0-pspell php7.0-recode php7.0-sqlite3 php7.0-tidy php7.0-xmlrpc php7.0-xsl php7.0-mbstring  +  apt-get -y install php7.0-mysql php7.0-curl php7.0-gd php7.0-intl php-pear php-imagick php7.0-imap php7.0-mcrypt php-memcache  php7.0-pspell php7.0-recode php7.0-sqlite3 php7.0-tidy php7.0-xmlrpc php7.0-xsl php7.0-mbstring
  
 ==== 权限 ==== ==== 权限 ====
 +与 php*.*-fpm 相关的文件权限 
   chown -R www-data:www-data /var/www/test && chmod -R 755 /var/www/test   chown -R www-data:www-data /var/www/test && chmod -R 755 /var/www/test
  
 ==== 一些问题的解决办法 ==== ==== 一些问题的解决办法 ====
  
-nginx搭建php提示No input file specified.+** nginx搭建php提示No input file specified.**
  
 打开fastcgi.conf 打开fastcgi.conf
wiki/linux/ubuntu-install-nginx-php-mysql.1570268009.txt.gz · 最后更改: 2023/01/03 15:24 (外部编辑)