Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to build and configure PHP in Linux

2025-03-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

How to build and configure PHP in Linux, in view of this problem, this article introduces the corresponding analysis and solution in detail, hoping to help more partners who want to solve this problem to find a more simple and feasible method.

PHP (Hypertext Preprocessor), that is, "hypertext preprocessor", is a scripting language executed on the server side, mainly used in Web server development, command line and writing desktop applications.

1. Install apache [root@VM_0_5_centos /] # yum-y install httpd the following figure indicates that the installation is successful!

two。 Install php [root@VM_0_5_centos /] # yum-y install php the following figure indicates that the installation is successful

3. Install php-fpm [root@VM_0_5_centos /] # yum-y install php-fpm the following figure indicates that the installation is successful

4. Install php-mysql [root@VM_0_5_centos /] # yum-y install php-mysql the following figure indicates that the installation is successful

5. Install apache extension [root@VM_0_5_centos /] # yum-y install httpd-manual mod_ssl mod_perl mod_auth_mysql the following figure indicates that the installation is successful

6. The extension to install php [root@VM_0_5_centos /] # yum-y install php-gd php-xml php-mbstring php-ldap php-pear php-xmlrpc appears in the following figure to indicate that the installation is successful

All the things needed so far have been installed. Start apache [root@VM_0_5_centos /] # service httpd start

Enter "http://localhost/" test" in the browser address bar to see if it is available. The effect is as follows

The following figure indicates that the apache server is available. Note that if nginx or other servers occupy port 80, it will not start successfully.

two。 Test php

Enter the web root directory of apache: / var/www/html remember this path address, upload the project to this address when uploading FTP or SSH, or of course you can reconfigure or host files yourself.

Write a test here to see if the php check is available.

[root@VM_0_5_centos html] # vi test.php

Insert the following:

Save: wq enter

Enter "http://localhost/test.php" test" in the browser address bar to see if it is available. The effect is as follows

The following figure indicates that the php service is available. If it cannot be displayed, please note whether the php extension and apache are installed successfully.

We're done! Next, you can drop the required projects into the "/ var/www/html" directory!

In PHP, all variables are page-level, and both global variables and static members of the class are emptied after the page is executed.

This is the answer to the question about how to build and configure PHP in Linux. I hope the above content can be of some help to you. If you still have a lot of doubts to be solved, you can follow the industry information channel for more related knowledge.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report