Today in learning thinkphp encountered a lot of problems, in order to be able to better study today to take the afternoon time, the development of the lamp environment in a number of attempts, after all, have done a lot of Linux-related work, plus PHP itself the best collocation is the lamp environment, Starting today into the Linux environment for Development,
The first is to build the lamp environment, here is not too much to repeat, after all, is the development of test environment, if you and I use the same Linux OS (CentOS) system so much easier, directly using the Yum source to install the rpm
Detailed configuration can view my blog in the garden I have written at least 4 5 times in front of the lamp environment documents are generally consistent with the requirements of the production environment to configure:
Http://www.cnblogs.com/patf/p/3382325.html
Http://www.cnblogs.com/patf/p/3376306.html
Open the appropriate port in the firewall
Vi/etc/sysconfig/iptables-a input-m State--state new-m tcp-p TCP--dport 80-j ACCEPT #允许80端口通过防火墙-A input-m State- -state new-m tcp-p tcp--dport 80-j ACCEPT #允许80端口通过防火墙-A input-m State--state new-m tcp-p TCP--dport 3306-j acce PT #允许3306端口通过防火墙
Yum-y Install httpd
Setting up a self-starting environment
Chkconfig httpd on this default is 2345 it should be if you don't want to drive too much, you can use Chkconfig--lovel 345 httpd on
View all turned on those can use Chkconfig--list httpd more can use man chkconfig or chkconfig--help to find
MySQL and PHP installation are identical
The main emphasis here is the installation of MySQL yum-y install MySQL mysql-devel mysql-server Optional can install MySQL client itself decided to mysql-cilent
Installing PHP yum-y install php php-mysql php-gd php-gd-devel php-......... I can't think of it. Some of the extensions of PHP what compression or GD library, such as GD is used to display pictures and verification code details can go to the PHP official website to view the configuration file
The configuration of the MySQL database under initialization after Setup is complete.
/usr/bin/mysql_secure_installation
Of course you can modify the configuration with the CP MY.CNF
After initializing it, trust that the root MySQL password should already be set up below it can be set using the root user
Under any path mysql-h localhost-u root-p Enter the password after entering the mysql> mode
You can set the root user remote access function, of course, you can set the root user telnet IP address or host for security, here my setting is to allow the root user to enter the password in any location to log in and manage all databases
Grant all on * * to [e-mail protected] '% ' identified by ' morohstk22 ';
This is done in our lamp environment! You can then write a index.php document under the default site phpinfo (); View the configuration below
These are old-fashioned, I'm not too much to repeat. But the premise is that this environment is not a production environment, must not be used in the production environment, the security level is very low!
Here are some of the problems encountered in the configuration thinkphp, such as: In the introduction of the thinkphp Portal file can not generate the site directory structure, is the issue of permissions, you can see the default execution of the Apache user who is, can be viewed in the configuration file
It's usually Apache and Apache. then we can use the Site Directory permissions for Apache and Apache users
Chown-r apache.apache/opt/www/thinkphp
Chmod-r 755/opt/www/thinkphp
Then the Chown-r apache:apache/var/www/html/thinkphp
Chmod-r 755/var/www/html/thinkphp
Then modify the next httpd.conf file under modify under the site under the Apache service/etc/init.d/httpd/restart Of course you may be compiled and installed Apache you can find/| grep http view under your Where does the bin directory perform his
Problem solving. The reason is not clear, may be the problem of Apache configuration, or the OPT directory permissions, because my/opt directory storage of a lot of data is not over the change if there is any time to know whether or when you can leave contact information or direct method, thank you
PHP thinkphp Deployment Linux