Home >Operation and Maintenance >Linux Operation and Maintenance >How to set up a linux server PHP environment

How to set up a linux server PHP environment

angryTom
angryTomOriginal
2020-02-05 14:19:254470browse

How to set up a linux server PHP environment

How to build a linux server PHP environment

1. Use yum to install php

How to set up a linux server PHP environment

#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.

How to set up a linux server PHP environment

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn