Apache fails to restart after PHP installation

Active3 hr before
Viewed126 times

8 Answers


Turns out I needed to put php5apache2_2.dll into my apache install folder and go into httpd.conf and change the "PhpIniDir" variable to be the path to the php.ini file in my PHP install folder., In "The Martian", why did they catch the probe? , Give third party check to charitable org? ,I make sure to choose Apache 2.2.x as my web server and chose the path to Apache2.2\conf for the Apache configuration path.

Actually, there is no need to copy the files. You simply need to provide the correct paths. I did not change any of the defaults when installing, and in my case the edits look like this in the httpd.conf file:

PHPIniDir "C:\Program Files\PHP"
LoadModule php5_module "C:\Program Files\PHP\php5apache2_2.dll"
load more v

If your Apache 2 web server is failing to execute PHP files, learn how to quickly remedy this issue. ,How to secure your Apache 2 server in four steps (TechRepublic),With apache2.conf open, all you have to do is add the following to the bottom of the file:,You should now be able to point a browser to a PHP file and watch it execute properly, as opposed to saving to your local drive or displaying code in your browser.

The first thing we must do is modify the main Apache 2 configuration file. To do this, open a terminal window and issue the command:

sudo nano / etc / apache2 / apache2.conf
load more v

You are unsure why or when you must restart your web server (Apache, PHP-FPM, Nginx, etc.) after:,Installing or upgrading the PHP agent,You must restart your web server when:,Update the PHP agentdocs

.css - vo7zhn {
   width: 100 % ;padding: 0;background: none;
}.css - vo7zhn
var, .css - vo7zhn mark {
   font - size: inherit;
}.css - vo7zhn
var {
   background: var (--color - nord - 2);color: inherit;
}.css - vo7zhn a: hover
var {
   background: var (--color - nord - 3);
}.css - vo7zhn mark.token {
   color: var (--color - neutrals - 900) !important;
apachectl stopapachectl start

Stack Exchange network consists of 178 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers. ,So long as everything is good, you can delete the pcre-bak directory. This happened because PHP made the switch from PCRE to PCRE2 in version 7.3. Ubuntu 20.04 will install PHP 7.4 unless specifically told not to.,I updated to 20.04 and did not test apache2 right away. However after trying to install php with:, If the Haste spell is cast on a Bladesinging wizard, can the Bladesinger cast three cantrips in a turn using the Extra Attack feature?

While it's been a while since the error was reported, you can generally do this to resolve the issue:

   mkdir pcre - bak
cd pcre - bak
mv / usr / local / lib / libpcre * .
load more v

Now can switch between versions of PHP easily.,The problem was that I didn't disabled php7.0 mod.,I run sudo a2dimod php7.0 and everything works fine now.,After installation of php5 I executed sudo a2enmod php5.6

The problem was that I didn't disabled php7.0 mod.

I run sudo a2dimod php7.0 and everything works fine now.

sudo a2dimod php7 .0

How to set up Mariadb Galera cluster on Ubuntu or Debian Linux,How to set up Redis sentinel cluster on Ubuntu or Debian Linux,You can either use service or /etc/init.d/ command as follows on Debian Linux version 7.x or Ubuntu Linux version Ubuntu 14.10 or older:,Ubuntu Linux: Start / Restart / Stop Nginx Web Server

apache2.service - The Apache HTTP Server
Loaded: loaded(/lib/systemd / system / apache2.service; enabled; vendor preset: enabled)
Active: active(running) since Wed 2021 - 02 - 24 20: 39: 39 UTC;
5 days ago
Docs: https: //httpd.apache.org/docs/2.4/
   Process: 115 ExecStart = /usr/sbin / apachectl start(code = exited, status = 0 / SUCCESS)
Process: 15247 ExecReload = /usr/sbin / apachectl graceful(code = exited, status = 0 / SUCCESS)
Main PID: 128(apache2)
Tasks: 6(limit: 4672)
Memory: 16.4 M
CGroup: /system.slice/apache2.service├─ 128 / usr / sbin / apache2 - k start├─ 15254 / usr / sbin / apache2 - k start├─ 15255 / usr / sbin / apache2 - k start├─ 15256 / usr / sbin / apache2 - k start├─ 15257 / usr / sbin / apache2 - k start└─ 15258 / usr / sbin / apache2 - k start

Feb 27 00: 00: 23 ubuntu - db - mgmnt systemd[1]: Reloaded The Apache HTTP Server.
Feb 28 00: 00: 23 ubuntu - db - mgmnt systemd[1]: Reloading The Apache HTTP Server.

We need to use the service command as root user:
# service apache2 start
# service apache2 stop
# service apache2 status
# service apache2 restart


 * Stopping apache2...
    Starting apache2

First, use the type command or command command to find the apachectl or apachectl2 path:
type -a apachectl
type -a apache2ctl

Outputs from the Ubuntu Linux 20.04 LTS server:

apachectl is / usr / sbin / apachectl
apachectl is / sbin / apachectl
load more v

Sorry for late reply again. I rebooted the server and the error is still showing up,apache2: Syntax error on line 268 of /etc/apache2/apache2.conf: Syntax error on line 30 of /etc/apache2/sites-enabled/000-default: Expected </Directory> but saw </VirtualHost> Action ‘configtest’ failed. The Apache error log may have more information. can anyone help me?,Run this command to show the last 20 lines from the error log:,wrong command, when i do service apache 2 start is says

load more v

After you have signaled httpd, you can read about its progress by issuing:,Apache HTTP Server Version 2.4,To send a signal to the parent you should issue a command such as:,Users of mod_status will notice that the server statistics are set to zero when a HUP is sent.

load more v

Other "restart-apache" queries related to "Apache fails to restart after PHP installation"