linux下安装php5的方法:1、下载所需版本PHP源码包;2、执行“tar xzf php-5.6.14.tar.gz”;3、编译安装;4、配置PHP即可。

本文操作环境:linux5.9.8系统、PHP 5.6版,DELL G3电脑
linux下怎么安装php5?
Linux 下编译安装 PHP 5.6
若系统已使用yum安装php, 先卸载php
立即学习“PHP免费学习笔记(深入)”;
# rpm -qa | grep php php-mcrypt-5.3.3-3.el6.x86_64 php-pgsql-5.3.3-46.el6_6.x86_64 php-xmlrpc-5.3.3-46.el6_6.x86_64 ... # rpm -e php-mcrypt-5.3.3 ....
下载 PHP 源码包
1. http://php.net/downloads.php,下载所需版本PHP 源码包后, 上传至linux服务器
2. tar xzf php-5.6.14.tar.gz
安装依赖
注意:请在linux环境下测试或生产使用 青鸟内测是一个移动应用分发系统,支持安卓苹果应用上传与下载,并且还能快捷封装网址为应用。应用内测分发:一键上传APP应用包,自动生成下载链接和二维码,方便用户内测下载。应用封装:一键即可生成app,无需写代码,可视化编辑、 直接拖拽组件制作页面的高效平台。工具箱:安卓证书生成、提取UDID、Plist文件在线制作、IOS封装、APP图标在线制作APP分发:
0
# yum -y install gcc bison bison-devel zlib-devel libmcrypt-devel mcrypt mhash-devel openssl-devel libxml2-devel libcurl-devel bzip2-devel readline-devel libedit-devel sqlite-devel
编译安装
# ./configure \ --enable-inline-optimization \ --disable-debug \ --disable-rpath \ --enable-shared \ --enable-opcache \ --enable-fpm \ --with-mysql \ --with-mysqli \ --with-pdo-mysql \ --with-gettext \ --enable-mbstring \ --with-iconv \ --with-mcrypt \ --with-mhash \ --with-openssl \ --enable-bcmath \ --enable-soap \ --with-libxml-dir \ --enable-pcntl \ --enable-shmop \ --enable-sysvmsg \ --enable-sysvsem \ --enable-sysvshm \ --enable-sockets \ --with-curl \ --with-zlib \ --enable-zip \ --with-bz2 \ --with-readline # make # make install
如果想重新安装:
# make clean # make clean all # ./configure... # make # make install
配置 PHP
配置文件:
# cp php.ini-development /usr/local/php56/etc/php.ini
php-fpm 服务
# cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf # cp sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm # chmod +x /etc/init.d/php-fpm
启动 php-fpm
# service php-fpm start Starting php-fpm done
推荐学习:《PHP视频教程》
以上就是linux下怎么安装php5的详细内容,更多请关注php中文网其它相关文章!
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号