码迷,mamicode.com
首页 > Web开发 > 详细

部署PHP网站到linux服务器上后可能要解决的问题

时间:2016-01-13 10:39:46      阅读:195      评论:0      收藏:0      [点我收藏+]

标签:

1. Install mod
yum install php-pdo.x86_64
yum install php-mysql.x86_64
yum install php-ldap.x86_64

2. Create User and Grant privileges of database(admin always have the root user, but he will not give you this user and username)
create user ‘stadmin‘@‘%‘ identified by ‘stadmin‘;
grant all privileges on *.* to ‘stadmin‘@‘%‘;

3. create db and import db( prepare the database of your website or web app)

4. update main.php in db section( you may change the config file )
username: stadmin
password: *****

5. update /etc/php.ini (you may change the config file of this new server environment)
date.timezone = PRC

6. restart httpd (after change, don’t forget to restart the servers)
/etc/init.d/httpd restart

/etc/init.d/mysqld restart

 

7: Set the local server can use the network and use the database.(maybe you will encounter this situation, try this)

错误提示:CDbConnection failed to open the DB connection: SQLSTATE[HY000] [2003] Can‘t connect to MySQL server on ‘10.196.19.73‘

setsebool -P httpd_can_network_connect=1

setsebool -P httpd_can_network_connect_db =1

 

8: may have problem of url rewrite

 

部署PHP网站到linux服务器上后可能要解决的问题

标签:

原文地址:http://www.cnblogs.com/gaoqin-web/p/5126348.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!