php网站部署故障处理

1、网站无法使用旧版本php解析?

原因分析:安装时使用了默认版本或版本过低。

解决方法:安装指定php版本(以php7.1.*为例);指令为如下所述。

yum -y remove php*

rpm -Uvh https://mirror.webtatic.com/yum/el7/epel-release.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
yum repolist all
yum -y install php71w php71w-pear php71w-devel #安装php7.1版本
php -v
systemctl restart httpd

2、网站不能正常解析?http error500?

 原因分析:内部服务器错误。

解决方法:

sed -i 's/display_errors = Off/display_errors = On/' /etc/php.ini
sed -i 's/display_startup_errors = Off/display_startup_errors = On/' /etc/php.ini

systemctl restart httpd

3、网站无法访问install.php?

Warning: Unknown: failed to open stream: Permission denied in Unknown on line 0

Fatal error: Unknown: Failed opening required '/var/www/html/install.php' (include_path='.:/usr/share/pear:/usr/share/php') in Unknown on line 0

原因分析:install.php无可执行权限。

解决方法:chmod 750 install.php

 

4、网站安装时,无法配置时区?

Warning: date_default_timezone_get(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /var/www/html/ecshop/ECShop_V4.0.7_UTF8_release20200102/source/ecshop/install/includes/lib_installer.php on line 224

 

 原因分析:获取时区函数不安全。

解决方法:修改配置,并重启httpd。

sed -i 's/;date.timezone =/date.timezone = "PRC"/' /etc/php.ini
systemctl restart httpd;systemctl status httpd

 

 5、网站安装时无法连接数据库?

连接 数据库失败,请检查您输入的 数据库帐号 是否正确

原因分析:数据库不允许远程连接;

 解决方法:临时开启数据库远程连接;

 mysql -uroot -p123456 -e "show grants for root@'192.168.8.1';";history -c

 

7、网站安装时创建数据库失败?

创建配置文件............成功
创建数据库............失败
连接 数据库失败,请检查您输入的 数据库帐号 是否正确。

原因分析:web界面无法远程创建数据库。

解决方法:第三方工具创建数据库后直接选择。

 

原文地址:https://www.cnblogs.com/chalon/p/13283967.html