Build a PHP server environment on CentOS (available)

Source: Internet
Author: User
Tags php server

Original: https://www.cnblogs.com/zy2009/p/7047828.html

1, install Apache first:

Yum Install httpd configuration servernamevi/etc/httpd/conf/httpd.conf change #servername www.example.com:80 to ServerName localhost : 80 external machine at this time enter the server's IP address, you should see the Apache service page, the port does not lose, Apache default is to use 80 port to start apache:/etc/init.d/httpd start2.CentOS Installing MySQL and configuring remote access

Original: https://www.cnblogs.com/thecatcher/p/5780845.html

First check if you have MySQL installed in your system, use this command

grep MySQL

Check all MySQL-related packages. Installation is simple, a command

Yum install-y mysql-server MySQL mysql-devel

Wait a minute, put it in. Like the Yum tool, a button to get it done.

After the installation is complete, start MySQL via service mysqld start. The first time you start up, you make some initial configuration and pop out a bunch of things. Calm.

Use the following command to set the password for the root user of MySQL.

mysqladmin-u root Password ' NEW-PASSWD '

Then you can log in.

Mysql-u root-p

Log in to MySQL locally, execute grant all on the ' MySQL ' database, * * to [e-mail protected] ' IP ' identified by ' password '; Among them, user represents users, for me is ROOT,IP means the login machine IP, because my computer is DHCP, directly write a wildcard%. Password The password that the user corresponds to.

So my order is grant all privileges on * * to ' root ' @ '% ' identified by ' * * * * * * * * with GRANT option;

Perform the following, FLUSH privileges; Otherwise there may be a problem.

Restart MySQL, service mysqld restart.

4, install PHP

Yum install PHP php-devel restart Apache to make PHP effective/etc/init.d/httpd Restart at this point you can create a php file code in the directory:/var/www/html/: <?php phpinfo(); ?>
Then access this file, you can see some PHP information, php.ini configuration file path can be seen on this page to install PHP extensions yum  install php-mysql php-gd php-imap php-ldap php-odbc php-pear php-xml php-xmlrpcAfter installing the extension, you need to restart APACHE/ETC/INIT.D/HTTPD restart

Build a PHP server environment on CentOS (available)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.