Install PHP Runtime Environment on CentOS

Source: Internet
Author: User
Tags install php

can refer to, but I install the process is not exactly the same http://www.cnblogs.com/liulun/p/3535346.html

I first installed Apache, directly executed by yum-y install httpd

I checked the Apache-related packages

Install Apache complete

Test

Then install PHP, directly execute the yum-y install PHP

Then found that access to the PHP file directly display the source code, and then executed the

Yum-y Install Httpd-devel

Yum-u Install Php-devel

And then the visit was successful.

Then the MARIADB, because Centos7 has changed to this branch, the last installation of this hole.

But only installs the MARIADB still cannot execute, when connects the database and looks at the mariadb running state, discovers not even, at the same time the service does not rise, as

Then you have to install Mariadb-server,

After the installation is successful and then check his running status, the same is not started but the content is not the same, this time is purely not activated

Connect to the database because there are no passwords

Set boot up

Additional Configuration Reference

Http://www.linuxidc.com/Linux/2016-03/128880.htm

Digression: In fact, the last installation and this process is not quite the same. More direct installation of httpd and Httpd-devel as in the previous connection

Previously written installation steps, changed the port

Install Apache:
Yum Install httpd Httpd-devel
To start Apache:
/ETC/INIT.D/HTTPD start
Enter the server's IP address at this time, you should see the Apache service page, the port does not lose, Apache default is to use 80 port
Profile: Listening port in/etc/httpd/httpd.conf 80 to 81

Install PHP
Yum Install PHP Php-devel
Restart Apache to make PHP effective
/ETC/INIT.D/HTTPD restart
In this case, you can create a php file under directory:/var/www/html/
Code:
<?php phpinfo ();?>
Then access this file, you can see some PHP information, the path of the php.ini configuration file can be seen on this page

Install Extensions for PHP
Yum install php-mysql php-gd php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc
You need to restart Apache again after installing the extension
/ETC/INIT.D/HTTPD restart

Installing the PHP Runtime environment on CentOS

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.