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 install php and configure Apache server in linux

2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

1 php1.1 preparation work

You need to install Apache first, those that have been installed can be skipped, and those that are not installed can see here.

1.2 download

Official website

1.3 decompress tar-zxvf php-7.4.3.tar.gzcd php-7.4.31.4 compile and install. / configure-- prefix=/usr/local/php-- with-apxs2=/usr/local/apache/bin/apxs

Prefix is the installation location, and the later option is apxs under the apache installation directory bin. After that:

Make sudo make install1.5 profile

You need to copy a php.ini file:

Sudo cp php.ini-development / usr/local/lib/php.ini2 Apache

At the end of conf/httpd.conf, add:

LoadModule php7_module modules/libphp7.so SetHandler application/x-httpd-php

If php5, please change it to:

LoadModule php5_module modules/libphp5.so

Finally, restart the apache service:

/ usr/local/apache/bin/apachectl restart3 test

Create a new test.php under htdocs under the apache directory:

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

Servers

Wechat

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

12
Report