本文简述了Linux下安装PHP APACHE MYSQL PERL的方法和基本步骤
硬件环境
硬盘 G 内存 M 网卡 EEpor
软件
*** 作系统 RedHat
优化RedHat
安装时选择 ftp 和 dns
编辑文件 /etc/hosts
改为 info langoit cn info
编辑文件 /etc/named conf
改为
// generated by named bootconf pl
options { directory /var/named forwarders { }forwards only// query source address * port }
// // a caching only nameserver config // zone in { type hintfile named ca }
zone in addr arpa in { type masterfile named local }
编辑文件 /etc/resolv conf
改为 search langoit cn nameserver nameserver
优化linux 内核
删除没有的rpm 包
首先要停止正在运行的进程
cd /etc/rc d/init d
/sendmail stop /apmd stop /kudzu stop
rpm e nodeps sendmail kudzu nfs utils
编辑文件 /usr/src/linux/include/linux/tasks h
编辑第十四行 (vi + ) :
NR_TASKS >MIN_TASKS_LEFT_FOR_ROOT >
编辑文件 /usr/src/linux/Makefile
编辑第十八行 (vi + ) :
HOSTCC =gcc >HOSTCC =egcs
编辑第二十五行 (vi + ) :
CC =$(CROSS_PILE)gcc D__KERNEL__ I$(HPATH) >CC =$(CROSS_PILE)egcs D__KERNEL__ I$(HPATH)
编辑第九十行 (vi + ) :
CFLAGS = Wall Wstrict prototypes O fomit frame pointer >CFLAGS = Wall Wstrict prototypes O funroll loops ffast math malign double mcpu= pentiumpro march=pentiumpro fomit frame pointer fno exceptions
编辑第十九行 (vi + ) :
HOSTCFLAGS = Wall Wstrict prototypes O fomit frame pointer >HOSTCFLAGS = Wall Wstrict prototypes O funroll loops ffast math malign double mcpu= pentiumpro march=pentiumpro fomit frame pointer fno exceptions
设置内核
make xconfig
具体可自己根据系统来设置
在 /usr/src/linux/ 目录下
make dep make clean make bzlilo make modules make modules_install
安装和优化mm mysql apache php phpMyAdmin perl mode_perl
) 文件 mm: mm tar gz mysql: mysql tar gz apache: apache_ tar gz php: php tar gz phpMyAdmin: phpMyAdmin_ tar gz mode_perl: mod_perl tar gz perl DBI: DBI tar gz DBD Oracle tar gz Msql Mysql modules tar gz Data Dumper tar gz Data ShowTable tar gz eperl: eperl tar gz perl: perl tar gz
解压文件
tar zxpf 文件名
注意 以下所有的预编译和安装必须在要安装的软件目录下
#) 安装mm /configure \ disable shared \ prefix=/usr make make test make install make clean
#) mysql的安装和配置
#) mysql的预编译
CC= egcs \ OPTIM= O funroll loops ffast math malign double mcpu=pentiumpro \ march=pentiumpro fomit frame pointer fno exceptions \ /configure \ prefix=/mysql \
#) 安装mysql
make make install make clean
#) 配置mysql
/mysql/bin/mysql_install_db
初始化数据库 cp /mysql/share/mysql/mysql server /etc/rc d/init d/mysql cd /etc/rc d/rc d ln s /init d/mysql S mysql
系统启动时加载mysql
#) apache 的预编译
CC= egcs \ OPTIM= O funroll loops ffast math malign double mcpu=pentiumpro \ march=pentiumpro fomit frame pointer fno exceptions \ CFLAGS= DDYNAMIC_MODULE_LIMIT= \ /configure \ prefix=/apache \
#) php的预编译
CC= egcs \ OPTIM= O funroll loops ffast math malign double mcpu=pentiumpro \ march=pentiumpro fomit frame pointer fno exceptions \ /configure \ prefix=/usr \ with apache= /apache_ \ enable safe mode \ with mm \ enable inline optimization \ enable memory limit \ enable track vars \ with mysql=/mysql \
#) 安装php
make make install make clean
#) mode_perl 的预编译
perl Makefile PL \ EVERYTHING= \ APACHE_SRC= /apache_ /src \ USE_APACI= \ DO_HTTPD=
#) 安装mod_perl
make make install make clean
#) 编译apache
EAPI_MM=SYSTEM \ CC= egcs \ OPTIM= O funroll loops ffast math malign double mcpu=pentiumpro \ march=pentiumpro fomit frame pointer fno exceptions \ CFLAGS= DDYNAMIC_MODULE_LIMIT= \ /configure \ prefix=/apache \ activate module=src/modules/php /libphp a \ enable module=php \ activate module=src/modules/perl/libperl a \ enable module=perl
#) 安装apache
make make install make clean
cp /apache/bin/apachectl /etc/rc d/init d/d cd /etc/rc d/rc d ln s /init d/d S d
系统启动时加载apache
#) 安装eperl
perl Makefile PL
make make test make install make clean frame pointer fno exceptions \ CFLAGS= DDYNAMIC_MODULE_LIMIT= \ /configure \ prefix=/apache \ activate module=src/modules/php /libphp a \ enable module=php \ activate module=src/modules/perl/libperl a \ enable module=perl
#) 安装apache
make make install make clean
cp /apache/bin/apachectl /etc/rc d/init d/d cd /etc/rc d/rc d ln s /init d/d S d
系统启动时加载apache
#) 安装eperl
perl Makefile PL
make make test make install make clean
lishixinzhi/Article/program/MySQL/201311/29656先安装前面的教程,再安装后面的
参考教程1:
https://blog.csdn.net/weixin_43731793/article/details/91488289
参考教程2:
http://www.bubuko.com/infodetail-2931909.html
安装PHP
1、安装PHP73
1.1、卸载旧版本PHP
yum remove php*
1.2、安装EPEL:
sudo yum install epel-release
1.3、安装remi(选一个):
sudo rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
1.4、查看目前有php的什么版本(可忽略)
sudo yum list php*
1.5、列出所有的php相关的rpm包(可忽略)
rpm -qa|grep php
1.6、删除php相关的rpm包(一次只能删除一个)(可忽略)
rpm -e php72w-mysqlnd-7.2.17-1.w7.x86_64
1.7、列出remi仓库下所有PHP7.3可用模块。(可忽略)
yum --enablerepo=remi-php73 search php | grep php73
1.8、安装PHP 7.3
yum --enablerepo=remi-php73 install php
1、安装 PHP7.3:
(解决yum安装apache关联不了PHP的问题,用以下命令安装)
yum --enablerepo=remi-php73 install php
安装模块
yum --enablerepo=remi-php73 install php73-php-fpm php73-php-cli php73-php-bcmath php73-php-gd php73-php-json php73-php-mbstring php73-php-mcrypt php73-php-mysqlnd php73-php-opcache php73-php-pdo php73-php-pecl-crypto php73-php-pecl-mcrypt php73-php-pecl-geoip php73-php-recode php73-php-snmp php73-php-soap php73-php-xml
2、设置开机启动、运行服务:
systemctl enable php73-php-fpm
systemctl start php73-php-fpm
3、查找php.ini位置:
find /etc/opt/remi/php73 -name php.ini
/etc/opt/remi/php73/php.ini
找到apache的配置文件:httpd.conf
sudo find / -name httpd.conf
位置如下:
/etc/httpd/conf/httpd.conf
5、PHP日常 *** 作
systemctl restart php73-php-fpm #重启
systemctl start php73-php-fpm #启动
systemctl stop php73-php-fpm #关闭
systemctl status php73-php-fpm #检查状态
php -m #查看PHP已安装拓展模块
php -v #查看PHP版本
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)