• 欢迎访问搞代码网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站!
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏搞代码吧

PHP源码编译安装的简单整理

php 搞代码 4年前 (2022-01-23) 11次浏览 已收录 0个评论

PHP源码编译安装配置
下载地址
http://php.net/downloads.php

CentOS下预装依赖,具体自己对应添加 一般情况下面足够
yum install gcc make gd-devel libjpeg-devel libpng-devel libxml2-devel bzip2-devel libcurl-devel -y

PHP常用配置添加
./configure –prefix=/usr/local/php \
–with-config-file-path=/usr/local/php/etc –with-bz2 –with-curl \
–enable-ftp –enable-sockets –disable-ipv6 –with-gd \
–with-jpeg-dir=/usr/local –with-png-dir=/usr/local \
–with-freetype-dir=/usr/local –enable-gd-native-ttf \
–with-iconv-dir=/usr/local –enable-mbstring –enable-calendar \
–with-gettext –with-libxml-dir=/usr/local –with-zlib \
–with-pdo-mysql=mysqlnd –with-mysqli=mysqlnd –with-mysql=mysqlnd \
–enable-dom –enable-xml –enable-fpm –with-libdir=lib64 –enable-bcmath

最后
make&&ma本文来源[email protected]搞@^&代*@码)网9搞代gaodaima码ke install

拷贝PHP配置文件以及FPM配置文件 FPM默认端口是9000 Nginx通过此端口代理PHP的FastCGI模块
cp php.ini-production /usr/local/php/etc/php.ini
cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php-5.5.0/etc/php-fpm.conf

最后在Nginx.conf下的server段添加如下节连接PHP fast cgi
location ~ .*\.(php)?$
{
expires -1s;
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
include fastcgi_params;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass 127.0.0.1:9000;
}

测试语法是否正确
nginx -t

启动php-fpm 在php安装路径的sbin目录下 启动后
ps -ef| grep fpm 就可以查看到php-fpm的信息

启动Nginx,此时Nginx 已经连接 php-fpm提供的fastcgi服务。

版权声明:本文为博主原创文章,未经博主允许不得转载。


搞代码网(gaodaima.com)提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发送到邮箱[email protected],我们会在看到邮件的第一时间内为您处理,或直接联系QQ:872152909。本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:PHP源码编译安装的简单整理

喜欢 (0)
[搞代码]
分享 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址