㈠ centos 下如何通过yum安装最新的php
remi源,这里的php版本较新,5.4,5.5,5.6都有,还有配套的各种扩展
rpms.famillecollet.com
Centos 6.默认下没有安装php组件,因此我们需要输入命令:yum -y install php 回车如下图。
不用管,程序会自动完成安装及配置。
Zend组件,Centos 6.3 里面是没有的,需要手动下载,及安装教程请点击下面链接:
到此前期的准备工作已完成,下面就要对Apache进行配置
输入命令 pd/conf/httpd.conf //打开Apache配置文件,
找到ServerTokens OS将“OS”改为“Prod “ 。//显示服务器运行错误信息。与下图一样,那么Apache你就配置成功了,如果不一样请仔细对比上面的教程是不是那个步骤少了#及字母拼写错了。
到此php运行环境便配置成功啦。
㈡ centos6.5怎么安装php5.5
1.******已安装Nginx******
ps -aux | grep nginx
netstat -anptu | grep 80
2.清除系统中php痕迹:
yum remove php
rm -rvf /etc/php
rm -rvf /etc/php.ini
rm -f /usr/bin/php
3.安装php所需软件包:
tar zxvf autoconf-2.68.tar.gz -C /usr/src
cd /usr/src/autoconf-2.68/
./configure && make && make install
tar zxvf libiconv-1.14.tar.gz -C /usr/src
cd /usr/src/libiconv-1.14/
./configure && make && make install
tar zxvf libmcrypt-2.5.8.tar.gz -C /usr/src
cd /usr/src/libmcrypt-2.5.8/
./configure && make && make install
ldconfig
cd libltdl/
./configure --enable-ltdl-install
make && make install
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
tar zxvf mhash-0.9.9.9.tar.gz -C /usr/src
cd /usr/src/mhash-0.9.9.9/
./configure && make && make install
tar zxvf mcrypt-2.6.8.tar.gz -C /usr/src
cd /usr/src/mcrypt-2.6.8/
./configure && make && make install
4.加载php动态模块:
ln -s /usr/local/lib/libmcrypt.la /usr/lib64/libmcrypt.la
ln -s /usr/local/lib/libmcrypt.so /usr/lib64/libmcrypt.so
ln -s /usr/local/lib/libmcrypt.so.4 /usr/lib64/libmcrypt.so.4
ln -s /usr/local/lib/libmcrypt.so.4.4.8
/usr/lib64/libmcrypt.so.4.4.8
ln -s /usr/local/lib/libmhash.a /usr/lib64/libmhash.a
ln -s /usr/local/lib/libmhash.la /usr/lib64/libmhash.la
ln -s /usr/local/lib/libmhash.so /usr/lib64/libmhash.so
ln -s /usr/local/lib/libmhash.so.2 /usr/lib64/libmhash.so.2
ln -s /usr/local/lib/libmhash.so.2.0.1
/usr/lib64/libmhash.so.2.0.1
cp -R /usr/lib64/libpng.* /usr/lib/
cp -R /usr/lib64/libjpeg.* /usr/lib/
echo "/lib" >> /etc/ld.so.conf
echo "/usr/lib" >> /etc/ld.so.conf
echo "/usr/lib64" >> /etc/ld.so.conf
echo "/usr/local/lib" >> /etc/ld.so.conf
echo "* soft nproc 65535" >> /etc/security/limits.conf
echo "* hard nproc 65535" >> /etc/security/limits.conf
echo "* soft nofile 65535" >> /etc/security/limits.conf
echo "* hard nofile 65535" >> /etc/security/limits.conf
echo "fs.file-max=65535" >> /etc/sysctl.conf
ldconfig
5.解压、配置、编译、安装php:
tar zxvf php-5.5.25.tar.gz -C /usr/src
cd /usr/src/php-5.5.25/
./configure --prefix=/usr/local/php \
--with-config-file-path=/usr/local/php/etc \
--enable-fpm \
--with-fpm-user=www \
--with-fpm-group=www \
--with-mysql=mysqlnd \
--with-mysqli=mysqlnd \
--with-pdo-mysql=mysqlnd \
--with-iconv-dir \
--with-freetype-dir \
--with-jpeg-dir \
--with-png-dir \
--with-zlib \
--with-libxml-dir=/usr \
--enable-xml \
--enable-opcache \
--disable-rpath \
--enable-bcmath \
--enable-shmop \
--enable-sysvsem \
--enable-inline-optimization \
--with-curl \
--enable-mbregex \
--enable-mbstring \
--with-mcrypt \
--enable-ftp \
--with-gd \
--enable-gd-native-ttf \
--with-openssl \
--with-mhash \
--enable-pcntl \
--enable-sockets \
--with-xmlrpc \
--enable-zip \
--enable-soap \
--without-pear \
--with-gettext \
--disable-fileinfo
make ZEND_EXTRA_LIBS='-liconv'
make install
6.链接php可执行文件:
ln -s /usr/local/php/bin/php /usr/bin/php
ln -s /usr/local/php/bin/phpize /usr/bin/phpize
ln -s /usr/local/php/sbin/php-fpm /usr/bin/php-fpm
7.编辑php.ini配置文件:
cp /usr/src/php-5.5.25/php.ini-proction
/usr/local/php/etc/php.ini
ln -s /usr/local/php/etc/php.ini /etc/php.ini
vim /etc/php.ini
[PHP]
engine = On
zend.ze1_compatibility_mode = Off
short_open_tag = On
asp_tags = Off
precision
= 12
y2k_compliance = On
output_buffering = On
zlib.output_compression = Off
implicit_flush = Off
unserialize_callback_func=
serialize_precision = 100
safe_mode = Off
safe_mode_gid = Off
safe_mode_include_dir =
safe_mode_exec_dir =
safe_mode_allowed_env_vars = PHP_
safe_mode_protected_env_vars = LD_LIBRARY_PATH
disable_functions =
passthru,exec,system,chroot,scandir,chgrp,chown,shell_exec,proc_open,proc_get_status,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,stream_socket_server,fsocket
disable_classes =
expose_php = On
error_reporting = E_ALL & ~E_NOTICE
display_errors = On
display_startup_errors = Off
log_errors = Off
log_errors_max_len = 1024
ignore_repeated_errors = Off
ignore_repeated_source = Off
report_memleaks = On
track_errors = Off
variables_order = "EGPCS"
register_globals = Off
register_long_arrays = Off
register_argc_argv = On
auto_globals_jit = On
post_max_size = 50M
magic_quotes_gpc = Off
magic_quotes_runtime = Off
magic_quotes_sybase = Off
auto_prepend_file =
auto_append_file =
default_mimetype = "text/html"
doc_root =
user_dir =
extension_dir =
"/usr/local/php/lib/php/extensions/no-debug-non-zts-20121212/"
enable_dl = On
cgi.fix_pathinfo=0
file_uploads = On
upload_max_filesize = 50M
max_file_uploads = 20
allow_url_fopen = On
allow_url_include = Off
default_socket_timeout = 60
[Date]
date.timezone = PRC
[filter]
[iconv]
[sqlite]
[Pcre]
[Syslog]
define_syslog_variables = Off
[mail function]
SMTP = localhost
smtp_port = 25
[SQL]
sql.safe_mode = Off
[ODBC]
odbc.allow_persistent = On
odbc.check_persistent = On
odbc.max_persistent = -1
odbc.max_links = -1
odbc.defaultlrl = 4096
odbc.defaultbinmode = 1
[MySQL]
mysql.allow_persistent = On
mysql.max_persistent = -1
mysql.max_links = -1
mysql.default_port =
mysql.default_socket =
mysql.default_host =
mysql.default_user =
mysql.default_password =
mysql.connect_timeout = 60
mysql.trace_mode = Off
[MySQLi]
mysqli.max_links = -1
mysqli.default_port = 3306
mysqli.default_socket =
mysqli.default_host =
mysqli.default_user =
mysqli.default_pw =
mysqli.reconnect = Off
[mSQL]
msql.allow_persistent = On
msql.max_persistent = -1
msql.max_links = -1
[OCI8]
[PostgresSQL]
pgsql.allow_persistent = On
pgsql.auto_reset_persistent = Off
pgsql.max_persistent = -1
pgsql.max_links = -1
pgsql.ignore_notice = 0
pgsql.log_notice = 0
[Sybase]
sybase.allow_persistent = On
sybase.max_persistent = -1
sybase.max_links = -1
sybase.min_error_severity = 10
sybase.min_message_severity = 10
sybase.compatability_mode = Off
[Sybase-CT]
sybct.allow_persistent = On
sybct.max_persistent = -1
sybct.max_links = -1
sybct.min_server_severity = 10
sybct.min_client_severity = 10
[bcmath]
bcmath.scale = 0
[browscap]
[Informix]
ifx.default_host =
ifx.default_user =
ifx.default_password =
ifx.allow_persistent = On
ifx.max_persistent = -1
ifx.max_links = -1
ifx.textasvarchar = 0
ifx.byteasvarchar = 0
ifx.charasvarchar = 0
ifx.blobinfile = 0
ifx.nullformat = 0
[Session]
session.save_handler = files
session.use_cookies = 1
session.name = PHPSESSID
session.auto_start = 0
session.cookie_lifetime = 0
session.cookie_path = /
session.cookie_domain =
session.cookie_httponly =
session.serialize_handler = php
session.gc_probability = 1
session.gc_divisor
= 100
session.gc_maxlifetime = 1440
session.bug_compat_42 = 1
session.bug_compat_warn = 1
session.referer_check =
session.entropy_length = 0
session.entropy_file =
session.cache_limiter = nocache
session.cache_expire = 180
session.use_trans_sid = 0
session.hash_function = 0
session.hash_bits_per_character = 4
url_rewriter.tags =
"a=href,area=href,frame=src,input=src,form=,fieldset="
[MSSQL]
mssql.allow_persistent = On
mssql.max_persistent = -1
mssql.max_links = -1
mssql.min_error_severity = 10
mssql.min_message_severity = 10
mssql.compatability_mode = Off
mssql.secure_connection = Off
[Assertion]
[COM]
[mbstring]
[FrontBase]
[gd]
[exif]
[Tidy]
tidy.clean_output = Off
[soap]
soap.wsdl_cache_enabled=1
soap.wsdl_cache_dir="/tmp"
soap.wsdl_cache_ttl=86400
[Zend Optimizer]
zend_extension =
/usr/local/php/lib/php/extensions/no-debug-non-zts-20121212/opcache.so
zend_loader.enable = 1
zend_loader.disable_licensing = 0
zend_loader.obfuscation_level_support = 3
8.编辑php-fpm.conf配置文件:
cp /usr/local/php/etc/php-fpm.conf.default
/usr/local/php/etc/php-fpm.conf
vim /usr/local/php/etc/php-fpm.conf
[global]
pid = /home/php/pid/php-fpm.pid
error_log = /home/php/log/php-fpm_error.log
log_level = notice
[www]
listen = 127.0.0.1:9000
listen.backlog = -1
listen.allowed_clients = 127.0.0.1
listen.owner = www
listen.group = www
listen.mode = 0666
user = www
group = www
pm = dynamic
pm.max_children = 10
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 6
request_terminate_timeout = 100
request_slowlog_timeout = 0
slowlog = /home/php/log/slow.log
9.编写php-fpm启动脚本
vim /etc/init.d/php-fpm
#!/bin/sh
# chkconfig:
2345 90
10
#
Description:
Start and
Stop php-fpm
# Provides:
php-fpm
#
Default-Start:
2 3 4 5
#
Default-Stop:
0 1 6
prefix=/usr/local/php
exec_prefix=${prefix}
php_fpm_BIN=${prefix}/sbin/php-fpm
php_fpm_CONF=${prefix}/etc/php-fpm.conf
php_fpm_PID=/home/php/pid/php-fpm.pid
php_opts="--fpm-config $php_fpm_CONF --pid $php_fpm_PID"
wait_for_pid () {
try=0
while test $try -lt 35 ; do
case "$1" in
'created')
if [ -f "$2" ] ; then
try=''
break
fi
;;
'removed')
if [ ! -f "$2" ] ; then
try=''
break
fi
;;
esac
echo -n .
try=`expr $try + 1`
sleep 1
done
}
case "$1" in
start)
echo -n "Starting php-fpm..."
$php_fpm_BIN --daemonize $php_opts
if [ "$?" != 0 ] ; then
echo " failed"
exit 1
fi
wait_for_pid created $php_fpm_PID
if [ -n "$try" ] ; then
echo " failed"
exit 1
else
echo " done"
fi
;;
stop)
echo -n "Stoping php-fpm..."
if [ ! -r $php_fpm_PID ] ; then
echo "warning, no pid file found - php-fpm is not running ?"
exit 1
fi
kill -QUIT `cat $php_fpm_PID`
wait_for_pid removed $php_fpm_PID
if [ -n "$try" ] ; then
echo " failed. Use force-quit"
exit 1
else
echo " done"
fi
;;
force-quit)
echo -n "Terminating php-fpm "
if [ ! -r $php_fpm_PID ] ; then
echo "warning, no pid file found - php-fpm is not running ?"
exit 1
fi
kill -TERM `cat $php_fpm_PID`
wait_for_pid removed $php_fpm_PID
if [ -n "$try" ] ; then
echo " failed"
exit 1
else
echo " done"
fi
;;
restart)
$0 stop
$0 start
;;
reload)
echo -n "Reload service php-fpm "
if [ ! -r $php_fpm_PID ] ; then
echo "warning, no pid file found - php-fpm is not running ?"
exit 1
fi
kill -USR2 `cat $php_fpm_PID`
echo " done"
;;
*)
echo "Usage: $0 {start|stop|force-quit|restart|reload}"
exit 1
;;
esac
10.创建目录并修改权限,重启nginx服务:
mkdir -p /home/php/log
mkdir -p /home/php/pid
chown -R www:www /home/php/log
chown -R www:www /home/php/pid
service nginx restart
11.添加php-fpm系统服务:
chmod +x /etc/init.d/php-fpm
chkconfig --add php-fpm
chkconfig --level 2345 php-fpm on
chkconfig --list | grep php-fpm
12.启动php-fpm服务:
service php-fpm start
ps -aux | grep php-fpm
netstat -anptu | grep 9000
13.配置php测试页:
vim /home/www/html/phpinfo.php
㈢ centos怎么安装php5.6
php5.6如果有rpm包的话,可以yum安装,不过好像rpm包版本没有呢么高,这样你就要下载php的 源码包自己编译安装了,有一些三方源可能有那么高版本的php,,这个需要换源,看你想怎么安装
㈣ 如何在centos7上安装php
您好,安装PHP的方式可以一步一步的按照教程去安装,这个可以到网上搜一搜,因为步骤太多,我就不复制粘贴了。但是我这里最推荐的就是使用phpstudy一键安装,没错,就是在linux上一键安装,可以去试一试。
黑马程序员的PHP是国内最早开设的真正人工智能课程。课程全面系统,紧跟时代潮流。
㈤ 怎么安装PHP环境
LAMP/LNMP 环境搭建
一.检查系统环境
1.确认centos版本
[root@localhost ~]# cat /etc/redhat-release
2.检查是否安装过apache
rpm -qa | grep httpd
或者:
apachectl -v
或者:
httpd -v
3.检查是否安装过Mysql
service mysqld start
如果未被识别则没有安装
如果系统安装过,或者安装失败,清理一下系统
4.清理Mysql痕迹
yum remove mysql
rm -f /etc/my.cnf
5.卸载Apache包
rpm -qa|grep httpd
注意:如果是新的系统或者你从来没有尝试安装过,则以上步骤省略
二.安装Apache、PHP、Mysql
停止防火墙服务
[root@localhost ~]# systemctl stop firewalld.service
禁用防火墙开机启动服务
[root@localhost ~]# systemctl disable firewalld.service
1.安装apache
[root@localhost ~]# yum -y install httpd
2.安装php
[root@localhost ~]# yum -y install php
3.安装php-fpm
[root@localhost ~]# yum -y install php-fpm
4.安装Mysql
[root@localhost ~]# yum -y install mysql
5.安装 mysql-server
[root@localhost ~]# yum install mariadb-server
CentOS 7+ 版本将MySQL数据库软件从默认的程序列表中移除,用mariadb代替了,entos7配置教程上,大多都是安装mariadb,因为centos7默认将mariadb视作mysql。
因为mysql被oracle收购后,原作者担心mysql闭源,所以又写了一个mariadb,这个数据库可以理解为mysql的分支。如果需要安装mariadb,只需通过yum就可。
6.安装 php-mysql
[root@localhost ~]# yum -y install php-mysql
三.安装基本常用扩展包
1.安装Apache扩展包
yum -y install httpd-manual mod_ssl mod_perl mod_auth_mysql
2.安装PHP扩展包
yum -y install php-gd php-xml php-mbstring php-ldap php-pear php-xmlrpc php-devel
3.安装Mysql扩展包
yum -y install mysql-connector-odbc mysql-devel libdbi-dbd-mysql
四.配置Apache、mysql开机启动
重启Apache、mysql服务(注意这里和centos6有区别,Cenots7+不能使用6的方式)
systemctl start httpd.service #启动apache
systemctl stop httpd.service #停止apache
systemctl restart httpd.service #重启apache
systemctl enable httpd.service #设置apache开机启动
重启数据库
#启动MariaDB
[root@localhost ~]# systemctl start mariadb.service
#停止MariaDB
[root@localhost ~]# systemctl stop mariadb.service
#重启MariaDB
[root@localhost ~]# systemctl restart mariadb.service
#设置开机启动
[root@localhost ~]# systemctl enable mariadb.service
五.配置Mysql
初次安装mysql是没有密码的,我们要设置密码,mysql的默认账户为root
方式1:设置 MySQL 数据 root 账户的密码:
[root@localhost ~]# mysql_secure_installation
当出现如下提示时候直接按回车:
Enter current password for root
出现如下再次回车:
Set root password? [Y/n]
出现如下提示输入你需要设置的密码,这里输入了root,输入密码是不显示的,回车后再输入一次确认:
New password:
接下来还会有四个确认,分别是:
Remove anonymous users? [Y/n]
Disallow root login remotely? [Y/n]
Remove test database and access to it? [Y/n]
Reload privilege tables now? [Y/n]
直接回车即可。
方式2:进入mysql mysql -r
修改mysql密码:set password for 'root'@'localhost'=password('root');
mysql授权远程连接(navicat等): grant all on *.* to root identified by 'root';
六.测试环境
我们在浏览器地址栏输入http://ip/,正常显示,说明我们的lamp 环境搭建成功
七.安装nginx
yum install yum-priorities -y
wget http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
rpm -ivh nginx-release-centos-7-0.el7.ngx.noarch.rpm
yum install nginx
Nginx 版本号可变更http://nginx.org/packages/centos/7/noarch/RPMS/$版本
八.配置nginx
1.nginx启动,停止,重启
systemctl start nginx.service #启动nginx
systemctl stop nginx.service #停止
systemctl restart nginx.service #重启
systemctl enable nginx.service #设置开机启动
更改nginx端口号(根据自己需求)
cd /etc/nginx/conf.d/
vim default.conf
把listen 80改成listen 81
3.访问http://ip:81即可看到nginx首页
安装完成访问时候需要启动php-fpm,不重启访问会出现下载文件,重启命令如下
systemctl start php-fpm.service #启动php-fpm
systemctl enable php-fpm.service #设置开机启动
4.更改nginx配置文件识别php
vi /etc/nginx/conf.d/default.conf,把之前的#给去掉就可以了,顺手改一下
location ~ .php$ {
root html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /usr/share/nginx/html/$fastcgi_script_name;
include fastcgi_params;
}
方法二 安装nginx
yum install nginx
启动nginx,并设置为开机启动
systemctl start nginx
systemctl enable nginx
5.在 /usr/share/nginx/html中新建一个test.php
访问http://ip:81/test.php即可看到php页面
修改完成配置记得启动apache 和php-fpm 哦!
九.负载配置
upstream site{
server 172.16.170.138;
server 172.16.170.139;
}
server {
listen 80;
server_name localhost;
#charset koi8-r;
#access_log /var/log/nginx/log/host.access.log main;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
proxy_pass http://site;
}
apache 默认目录 /var/www/html
nginx 默认目录 /usr/share/nginx/html
升级php版本
centos7 默认安装php是5.4
查看yum的可安装的php版本列表
yum provides php
开始升级PHP更新源:
rpm -Uvh https://mirror.webtatic.com/yum/el7/epel-release.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
yum remove php-common -y #移除系统自带的php-common
php72版本
yum install -y php72w php72w-opcache php72w-xml php72w-mcrypt php72w-gd php72w-devel php72w-mysql php72w-intl php72w-mbstring
php56版本
yum install -y php56w php56w-opcache php56w-xml php56w-mcrypt php56w-gd php56w-devel php56w-mysql php56w-intl php56w-mbstring #安装依赖包
查看php版本
php -v
安装php fpm:
yum install php72w-fpm
yum provides php-fpm #因为我是准备搭建lnmp,所以安装php-fpm,这里会提示多个安装源,选择5.6版本的安装就可以了
yum install php56w-fpm-5.6.31-1.w7.x86_64 -y
systemctl start php-fpm.service 【启动】
systemctl enable php-fpm.service【开机自启动】
CentOS yum有时出现“Could not retrieve mirrorlist ”的解决办法——resolv.conf的配置
原因:没有配置resolv.conf
解决方法:
到/etc目录下配置resolv.conf加入nameserver IP,如:
nameserver 8.8.8.8
nameserver 8.8.4.4
search localdomain
保存再次运行上面的命令就可以。
https://blog.csdn.net/mao834099514/article/details/73470001
nginx目录 : /usr/share/nginx/html
/etc/nginx/conf.d/default.conf nginx配置目录
apache目录 : /var/www/html
/etc/httpd/conf/httpd.conf apache配置文件
nginx 配置域名
cd /etc/nginx
cp default.conf imooc.conf
修改server_name imooc.test.com 以及项目目录
配置虚拟域名 windows 访问需要在host增加 linuxip
ServerName www.nine.com
DocumentRoot "/var/www/html/learnlaravel/public"
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
关闭防火墙
setenforce 0
㈥ linux centos 怎么安装 php编程 软件
Gettext
1 首先进入到php源码包中
cd /opt/php-5.1.2/ext/gettext
2 在gettext文件夹下产生configure文件
/opt/php/bin/phpize
3 配置编译
./configure --with-php-config=/opt/php/bin/php-config --with-gettext
make && make install
4 在/opt/php/lib/php/extensions下产生一个gettext.so文件
5 确定 php.ini文件中的extension_dir=/opt/php/lib/php/extensions 跟 extension=gettext.so
6 重新编译 php
Zlib
1 首先进入到php源码包中
cd /opt/php-5.1.2/ext/zlib
2 在zlib文件夹下产生configure文件
/opt/php/bin/phpize
3 配置编译
./configure --with-php-config=/opt/php/bin/php-config --with-zlib
make && make install
4 在/opt/php/lib/php/extensions下产生一个zlib.so文件
5 确定 php.ini文件中的extension_dir=/opt/php/lib/php/extensions 跟 extension=zlib.so
6 重新编译 php
mbString
配制mbstring扩展
1 运行 /opt/php/bin/phpize
2 进入到 php源码包中的ext/mbstring下
cd /opt/php-5.1.2/ext/mbstring
./configure --with-php-config=/opt/php/bin/php-config --enable-mbstring
make && make install
3 这样就在/opt/php/lib/php/extensions下生成一个mbstring.so
4然后保证extension_dir指向正确的位置,extension=php_mbstring.dll开启
这样mbstring就开启了
Mod_rewrite
以RHEL5为例
1)首次安装apache,在编译时增加--enable-rewrite选项。
如./configure --prefix=/usr/local/apachel --enable-so --enable-mods-shared=all --enable-rewrite --enable-cache
2)增加mod_rewrite模块
# find mod_rewrite.c //在apache的源码安装目录中寻找mod_rewrite.c文件
一般会在httpd-2.28/moles/mappers下
# /opt/httpd/bin/apxs -c mod_rewrite.c //apxs应指定绝对路径,在你当前正在使用apache的bin目录里
# /opt/httpd/bin/apxs -i -a -n mod_rewrite mod_rewrite.la
如果没有什么错误的话,应该在你的apache的moles目录中编译出一个mod_rewrite.so文件。
编辑httpd.conf文件,确认httpd.conf中已经包含mod_rewrite.so的加载语句,如下:
LoadMole rewrite_mole moles/mod_rewrite.so
这时,你的apache应该已经支持rewrite了。
重启apache即可。
㈦ linux centos 7 下用yum 安装iso镜像里自带的php5.4.16版本的但是没有php-fqm文件不知道怎么重启php服务
systemctl restart php-fpm.service #这条命令是重启php服务
下面是一个比较靠谱的php安装步骤:
先删除已有的php版本 ,执行下面的命令删除php
yum remove php-common
然后像安装那样问你是否继续的,输入yes即可
添加 yum 源
CentOS 6.x 的源
# rpm -Uvh http://download.Fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
# rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
安装 PHP
# yum install --enablerepo=remi,remi-php56 php php-opcache php-pecl-apcu php-devel php-mbstring php-mcrypt php-mysqlnd php-phpunit-PHPUnit php-pecl-xdebug php-pecl-xhprof php-pdo php-pear php-fpm php-cli php-xml php-bcmath php-process php-gd php-common
注:安装5.6版本为remi-php56,安装5.5版本为remi-php55
㈧ centos 下的nginx 怎么安装php5.6
你好,你可以去后盾人看下视频,后盾人有海量学习视频 高清画质 视频质量好 。
㈨ centos下,我怎么安装php和apache
查看是否有RPM包安装的这两个软件
rpm -qa |grep httpd #查看是否安装APACHE
rpm -qa |grep hph #查看是否安装php
如果有安装的话执行上两条命令时会显示已相应经安装的文件名,如果什么都没显示的话就说明没有安装
查看是否有编译安装的这两个软件
find / -name apaceh
find / -name php
如果有安装的话会有文件显示,没有显示的话说明没安装
要安装这两个软件最方便的就是将这台机器连上网然后执行以下两条命令
yum install apache
yum install php
㈩ centos6.5的php5.3.3这个版本怎么升级到5.6
简单介绍一下,如何在CentOS上安装PHP5.6。
配置yum源
追加CentOS 6.5的epel及remi源。
#rpm-Uvhhttp://ftp.iij.ad.jp/pub/linux/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm
#rpm-Uvhhttp://rpms.famillecollet.com/enterprise/remi-release-6.rpm
以下是CentOS 7.0的源。
#yuminstallepel-release
#rpm-ivhhttp://rpms.famillecollet.com/enterprise/remi-release-7.rpm
使用yum list命令查看可安装的包(Packege)。
#yumlist--enablerepo=remi--enablerepo=remi-php56|grepphp
安装PHP5.6
yum源配置好了,下一步就安装PHP5.6。
#yuminstall--enablerepo=remi--enablerepo=remi-php56phpphp-opcachephp-develphp-mbstringphp-mcryptphp-mysqlndphp-phpunit-PHPUnitphp-pecl-xdebugphp-pecl-xhprof
用PHP命令查看版本。
#php--version
PHP5.6.0(cli)(built:Sep3201419:51:31)
Copyright(c)1997-2014ThePHPGroup
ZendEnginev2.6.0,Copyright(c)1998-2014ZendTechnologies
withZendOPcachev7.0.4-dev,Copyright(c)1999-2014,byZendTechnologies
withXdebugv2.2.5,Copyright(c)2002-2014,byDerickRethans
在这里安装的版本是PHP5.6.0,细心的用户可能已经发现ZendGuardLoader变成Zend OPcahe了。
对从PHP5.5开始PHP代码缓存从APC变成了Zend OPcache了。
更多问题可以去php中文网问答社区提问http://www.php.cn/wenda.html,大神在线帮你解决,希望对你有帮助