What should I do if apache does not execute php?

藏色散人
Release: 2023-03-05 13:00:01
Original
3588 people have browsed it

The solution to the problem that apache does not execute php: first execute "locate libphp5.so"; then check whether APACHE has an SO file; then modify the APACHE configuration file "httpd.conf"; and finally restart apache.

What should I do if apache does not execute php?

Recommended: "PHP Video Tutorial"

apache does not execute PHP and displays code

First check whether PHP is installed. If it has been installed, first execute

locate libphp5.so
Copy after login

to check whether APACHE has an SO file. If not, then reinstall PHP. First execute php -i | grep configure Look at the previous configure parameters, and then add --with-apxs2=/usr/local/apache2/bin/apxs at the end. Note that this is the directory where APACHE is located. After reinstalling PHP, modify the APACHE configuration file httpd .conf

If not

LoadModule php5_module        modules/libphp5.so
Copy after login

In

AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
Copy after login

add these contents, then restart apache and execute apachectl -k graceful

The above is the detailed content of What should I do if apache does not execute php?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template