本篇文章分享了关于编译安装php的问题,很详细,有需要的朋友可以参考一下
假设所有依赖都已解决,如遇到未安装的程序则安装后继续
架设使用最高权限用户,如果不是则在命令前加上sudo
到PHP官网下载
解压到用户目录
tar jxvf php-5.6.5.tar.bz2
配置安装选项
立即学习“PHP免费学习笔记(深入)”;
./configure \
--prefix=/usr/local/php \
--with-config-file-path=/usr/local/php/etc \
--enable-zip \
--enable-fpm \
--enable-static \
--enable-debug \
--enable-calendar \
--enable-mbstring \
--enable-sockets \
--with-openssl \
--with-zlib \
--with-curl \
--with-gettext \
--with-iconv \
--with-pcre-regex \
--with-mcrypt \
--with-iconv \
--with-libdir=/lib/x86_64-linux-gnu \
--with-mysql=mysqlnd \
--with-mysqli=mysqlnd \
--with-pdo-mysql=mysqlnd
<br/>
编译程序
make
安装程序
make install
复制配置文件
cp ./php.ini-development /usr/local/php/etc/php.ini
启动php-fpm
/usr/local/php/sbin/php-fpm
添加php-fpm脚本到启动项
cp ./sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
chmod 755 /etc/init.d/php-fpm
相关推荐:
以上就是编译安装PHP-PHP教程 的详细内容,更多请关注php中文网其它相关文章!
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号