Score:0

Unable to start Apache2 after attempt to switch php version

cn flag

After trying to switch php versions on my local Apache2 installation I have been unable to restart Apache at all. When calling up systemctl status apache2.service I see the following message:

Oct 07 11:02:33 philipp-ubuntu-Inspiron-3670 apachectl[5221]: apache2: Syntax error on line 146 of /etc/apache2/apache2.conf: Syntax error on line 3 of /etc/apache2/mods-enabled/php7.4.load: Cannot load>

And that the 'start' failed.

Line 146 of the conf file is:

IncludeOptional mods-enabled/*.load

Line 3 of php7.4.load is:

LoadModule php7_module /usr/lib/apache2/modules/libphp7.4.so

Any hints would be greatly appreciated as I can no longer access any of my local web applications rn.

Thanks!

in flag
A few questions for you: Have you confirmed that `libphp7.4.so` exists? Which PHP versions are you working with? How did you make the change? Apache is sometimes very particular about the order a change must follow in order to work
Philipp Gysling avatar
cn flag
Hi there, thanks for getting back to me, it's much appreciated. You're right, even though php7.4 was listed as a possible option after querying the system for the alternatives and I got no error message when I enabled it with 'a2enmod php7.4', the module was not actually installed. I downloaded and installed php 7.4 and was then able to reboot Apache properly and with the different php versions if needed. Many thanks again!
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.