Home >Operation and Maintenance >Linux Operation and Maintenance >How to set up a linux server PHP environment
How to build a linux server PHP environment
1. Use yum to install php
#2. Restart the Apache server.
Note: You can use yum –y install httpd to install the apache server.
systemctl restart httpd
3. Install the php extension. After the installation is complete, you also need to restart the Apache server.
yum -y install php-gd php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-snmp php-soap curl curl-devel
4. Create in the /var/www/html directory l.php file and add the following code to save it.
<?php phpinfo(); ?>
5. Visit the l.php file in the site directory with your browser to see the effect.
Recommended related tutorials:
How to build a PHP server environment in CentOS
How to set up a PHP server environment in CentOS 7?
The above is the detailed content of How to set up a linux server PHP environment. For more information, please follow other related articles on the PHP Chinese website!