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

What to do if ubuntu does not parse php files

藏色散人
藏色散人Original
2022-10-18 11:20:241833browse

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

If it is displayed as

This module does not exist!

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

sudo apt-get remove --purge libapache2-mod-php
sudo apt-get install libapache2-mod-php

Then restart apache2

sudo /etc/init.d/apache2 restart

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

Then restart apache2

service apache2 restart

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

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!

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