CentOS8最全源码安装 LNMP - Mysql8 PHP8 (2)

https://www.php.net/manual/en/configure.about.php

安装过程中,会出现的错误 Error1、Package \'oniguruma\', required by wget https://github.com/kkos/oniguruma/archive/v6.9.6.tar.gz -O /usr/local/src/oniguruma-6.9.6.tar.gz cd /usr/local/src/ tar zxvf oniguruma-6.9.6.tar.gz cd oniguruma-6.9.6 ./autogen.sh ./configure make make install 3-2)编译安装 make make install // make install 之后提示下面语句,是正常的 // Installing PDO headers: /usr/local/php80/include/php/ext/pdo/ 3-3)验证PHP /usr/local/php80/bin/php -v 3-4)环境配置 cd /usr/local/src/php-8.0.0/ ln -s /usr/local/php80/bin/php /usr/bin/php80 cp php.ini-development /usr/local/php80/etc/php.ini cp /usr/local/php80/etc/php-fpm.conf.default /usr/local/php80/etc/php-fpm.conf cp /usr/local/php80/etc/php-fpm.d/www.conf.default /usr/local/php80/etc/php-fpm.d/www.conf cp xiaochuan/sapi/fpm/init.d.php-fpm /etc/init.d/php80-fpm chmod +x /etc/init.d/php80-fpm 3-5)验证配置路径 [root@MiWiFi-R3600-srv php-8.0.0]# php80 --ini Configuration File (php.ini) Path: /usr/local/php80/etc/ Loaded Configuration File: /usr/local/php80/etc/php.ini Scan for additional .ini files in: /usr/local/php80/etc/php.d Additional .ini files parsed: (none) 3-6)启动 fpm /etc/init.d/php80-fpm status /etc/init.d/php80-fpm start /etc/init.d/php80-fpm stop /etc/init.d/php80-fpm restart // 如果要开启多个版本的 php-fpm 需要修改配置 vim /usr/local/php80/etc/php-fpm.d/www.conf listen = 127.0.0.1:9001 // 36 行 // 保存,退出,可以启动了 3-7)验证 fpm ps aux | grep php-fpm 3-8)修改 nginx.cong 配置 vim /usr/local/nginx/conf/nginx.conf fastcgi_param SCRIPT_FILENAME /home$fastcgi_script_name; // 重启 nginx nginx -s reload 3-9)编写一个 php 文件 vim /home/index.php <?php phpinfo(); 浏览器访问

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/zggzff.html