Home > Article > Backend Development > How to install and configure php environment for ecs
Configuration method: 1. Use Xshell to connect to the ECS server; 2. Execute the "yum install httpd" command; 3. Configure the yum source; 4. Use the "yum install" command to install and configure PHP5.6; 5. Use the "yum install" command to install and configure mysql.
#The operating environment of this tutorial: windows7 system, PHP5.6&&apache2.2&&Postgresql version, DELL G3 computer
Configuration method of Alibaba Cloud ECS server PHP running environment
1. First use Xshell to connect to the server.
Open Xshell, create a new connection, and name it whatever you want. Enter your server IP address for the host, select the default value for the rest, click OK, and then enter the password. If the following page is displayed, it means you have successfully connected to the server.
2. Execute yum install httpd
chkconfig --levels 235 httpd on. If everything is normal, apache is installed. Enter your server IP address in the browser window. If the following screen appears, congratulations, you are one step closer to success. Got it!
yum install php , the PHP installed by the system is the relatively low version 5.3. If your program version requirements are not high, you can use this directly.
3, Configure the yum source
Add the epel and remi sources ofCentOS 6.5.
# rpm -Uvh http://ftp.iij.ad.jp/pub/linux/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm# rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpmThe following is the source of
CentOS 7.0.
# yum install epel-release# rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-7.rpmUse the yum list command to view the installable packages (Packege).
# yum list --enablerepo=remi --enablerepo=remi-php56 | grep php
4. Install PHP5.6
# yum install --enablerepo=remi --enablerepo=remi-php56 php php-opcache php-devel php-mbstring php-mcrypt php-mysqlnd php-phpunit-PHPUnit php-pecl-xdebug php-pecl-xhprofUse PHP command to check the version.
# php --versionPHP 5.6.0 (cli) (built: Sep 3 2014 19:51:31)Copyright (c) 1997-2014 The PHP GroupZend Engine v2.6.0, Copyright (c) 1998-2014 Zend Technologies with Zend OPcache v7.0.4-dev, Copyright (c) 1999-2014, by Zend Technologies with Xdebug v2.2.5, Copyright (c) 2002-2014, by Derick RethansThe version installed here is PHP5.6.0. Careful users may have discovered that
ZendGuardLoader has become Zend OPcahe.
Zend OPcache.
phpinfo()Look below:
##5. Install MySQL
Open the terminal, root user
yum install mysql mysql-server
After installation, set MySQL to start automatically
chkconfig --levels 235 mysqld on /etc/init.d/mysqld start //或者service mysqld start
mysql_secure_installation
Enter current paaword for root
Recommended learning:
php video tutorialThe above is the detailed content of How to install and configure php environment for ecs. For more information, please follow other related articles on the PHP Chinese website!