Home > Backend Development > PHP Problem > What to do if ubuntu does not parse php files

What to do if ubuntu does not parse php files

藏色散人
Release: 2023-03-17 06:26:01
Original
1917 people have browsed it

Solution to Ubuntu not parsing php files: 1. Completely uninstall "libapache2-mod-php" and reinstall it, then restart apache2; 2. Check on the server side whether the php module is turned on and pass "service apache2 restart" to restart apache2; 3. Install the "php7.0-curl" module.

What to do if ubuntu does not parse php files

The operating environment of this tutorial: ubuntu 16.04 system, PHP8.1 version, DELL G3 computer

ubuntu does not resolve What to do with php files?

1. Execute:

sudo apt-get install libapache2-mod-php
sudo a2enmod php
Copy after login

If it is displayed as

This module does not exist!
Copy after login

, completely uninstall libapache2-mod-php and then reinstall it:

sudo apt-get remove --purge libapache2-mod-php
sudo apt-get install libapache2-mod-php
Copy after login

Then restart apache2

sudo /etc/init.d/apache2 restart
Copy after login

Problem solution

2. First check whether the php module is enabled on the server side

root@529273e3c721:/var/www/html# a2dismod php7.0
Module php7.0 already disabled
root@529273e3c721:/var/www/html# a2enmod php7.0
Considering conflict php5 for php7.0:
Enabling module php7.0.
To activate the new configuration, you need to run:
  service apache2 restart
Copy after login

Then restart apache2

service apache2 restart
Copy after login

3. Confirm whether the following modules have been installed

sudo apt-get install php7.4-fpm php7.0-mysql php7.0-common php7.0-mbstring php7.0-gd php7.0-json php7.0-cli php7.0-curl libapache2-mod-php7.0
Copy after login

I had this problem due to the lack of php7.0-curl, which was solved after installation.

Recommended learning: "PHP Video Tutorial"

The above is the detailed content of What to do if ubuntu does not parse php files. 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