php8开发环境安装教程

上传人:d**** 文档编号:357939286 上传时间:2023-08-15 格式:DOC 页数:11 大小:70KB
返回 下载 相关 举报
php8开发环境安装教程_第1页
第1页 / 共11页
php8开发环境安装教程_第2页
第2页 / 共11页
php8开发环境安装教程_第3页
第3页 / 共11页
php8开发环境安装教程_第4页
第4页 / 共11页
php8开发环境安装教程_第5页
第5页 / 共11页
点击查看更多>>
资源描述

《php8开发环境安装教程》由会员分享,可在线阅读,更多相关《php8开发环境安装教程(11页珍藏版)》请在金锄头文库上搜索。

1、CentOS Linux release 7.4.1708 (Core)php-8.2.0.tar.gznginx-1.22.1.tar.gzmysql-8.0.31-linux-glibc2.17-x86_64-minimal.tar.xzmemcached-1.6.20.tar.gz先安装当前最新版cmake-3.25.1.tar.gztar -zxvf cmake-3.25.1.tar.gz -C /usr/local/设置环境变量echo export CMAKE_HOME=/opt/cmakeexport PATH=$CMAKE_HOME/bin:$PATH /etc/profile

2、.d/cmake.shsource /etc/profile.d/cmake.sh #让环境变量生效cmake -version安装最新版libzip-1.9.2.tar.gztar -zxvf libzip-1.9.2.tar.gzcd libzip-1.9.2mkdir buildcd buildcmake .make install安装nginxtar -zxvf nginx-1.22.1.tar.gzcd nginx-1.22.1./configure-prefix=/usr/local/nginx -with-http_stub_status_module -with-http_gz

3、ip_static_module -with-http_realip_module -with-http_sub_module -with-http_ssl_modulemake & make install添加全局命令ln -s /usr/local/nginx/sbin/nginx /usr/bin/nginx测试nginx -Vnginx注册到systemctl管理vim /lib/systemd/system/nginx.serviceUnitDescription=nginx serviceAfter=network.targetServiceType=forkingExecStar

4、t=/usr/local/nginx/sbin/nginxExecReload=/usr/local/nginx/sbin/nginx -s reloadExecStop=/usr/local/nginx/sbin/nginx -s stopPrivateTmp=trueInstallWantedBy=multi-user.targetsystemctl daemon-reloadsystemctl start nginx.servicesystemctl enablenginx.service 设置nginx.service 开机启动systemctl stopnginx.service #

5、 停止服务systemctl restartnginx.service # 重新启动服务systemctl statusnginx.service # 查看服务当前状态systemctl disablenginx.service # 停止开机自启动systemctl reload nginx.servicesystemctl list-units -type=service查看所有已启动的服务systemctl list-unit-files 查看所有开机启动的服务systemctl list-unit-files | grep nginx配置nginx.conf在server 下面增加loc

6、ation .php$ roothtml;fastcgi_pass127.0.0.1:9000;fastcgi_indexindex.php;fastcgi_paramSCRIPT_FILENAME$document_root$fastcgi_script_name;includefastcgi_params;安装phpyum -y install libxslt-devel libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc

7、glibc-devel glib2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5-devel libidn libidn-devel openssl openssl-devel sqlite-devel libcurl-devel libpng-devel libjpeg-devel freetype-devel libicu-devel oniguruma-devel libxslt-develtar -zxvf php-8.2.1.tar.gzcd php-8.2.1./co

8、nfigure -prefix=/usr/local/php8 -with-config-file-path=/usr/local/php8/etc -with-config-file-scan-dir=/usr/local/php8/php.d -enable-mysqlnd -with-mysqli -with-pdo-mysql -enable-fpm -with-fpm-user=www -with-fpm-group=www -with-gd -with-iconv -with-zlib -enable-xml -enable-shmop -enable-sysvsem -enabl

9、e-inline-optimization -enable-mbregex -enable-mbstring -enable-ftp -with-openssl -enable-pcntl -enable-sockets -with-xmlrpc -enable-zip -enable-soap -without-pear -with-gettext -enable-session -with-curl -with-jpeg-dir -with-freetype-dir -enable-opcache报错:configure: error: Package requirements (onig

10、uruma) were not met原因是没有安装配置oniguruma导致的yum -y install yum -y install make -j 2 & make install#采用两个核心编译cp php.ini-production /usr/local/php8/etc/php.inivim /usr/local/php8/etc/php.ini +1371 #php的Session存储目录 1371session.save_path = /tmp #将注释打开cd /usr/local/php8/etccp php-fpm.conf.default php-fpm.conf

11、vim php-fpm.conf +17pid = /var/run/php-fpm.pid#将注释取消并修改# php-fpm参数优化cd /usr/local/php8/etc/php-fpm.d/vim www.conf输入wwwlisten = 127.0.0.1:9000listen.mode = 0666user = wwwgroup = wwwpm = dynamicpm.max_children = 128pm.start_servers = 20pm.min_spare_servers = 5pm.max_spare_servers = 35pm.max_requests =

12、 10000rlimit_files = 1024slowlog = log/$pool.log.slow配置 php-fpm 系统环境变量vim /etc/profile.d/php.sh输入以下两行export PHP_HOME=/usr/local/php8export PATH=$PATH:$PHP_HOME/bin:$PHP_HOME/sbinsource /etc/profile.d/php.shecho $PATH配置 php-fpm 开机自启动vim /lib/systemd/system/php-fpm.serviceUnitDescription=php-fpmAfter=

13、network.targetServiceType=forkingExecStart=/usr/local/php8/sbin/php-fpmExecStop=/bin/pkill -9 php-fpmPrivateTmp=trueInstallWantedBy=multi-user.targetphp-fpm.service 文件说明Unit:服务的说明Description:描述服务After:描述服务类别Service服务运行参数的设置Type=forking是后台运行的形式ExecStart为服务的具体运行命令ExecReload为重启命令ExecStop为停止命令PrivateTmp=True表示给服务分配独立的临时空间注意:Service的启动、重启、停止命令全部要求使用绝对路径Install运行级别下服务安装的相关设置,可设置为多用户,即系统运行级别为3systemctl daemon-reloadpkill php-fpmsystemctl start php-fpm.s

展开阅读全文
相关资源
相关搜索

当前位置:首页 > IT计算机/网络 > PHP资料

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号