View previous topic :: View next topic |
Author |
Message |
67comet Apprentice
Joined: 29 Oct 2004 Posts: 262 Location: Ogden, UT
|
Posted: Thu Aug 12, 2021 5:58 pm Post subject: (Solved) PHP Isn't Playing With Apache2 |
|
|
Hello,
I'm working on a server that I do not have physical access to (ssh in from my location). It is an older 32bit computer (thus my love for Gentoo grows).
I installed Wordpress (It's my go-to for my friends that want to run their own servers out of their homes).
Gentoo and me haven't played with each other in quite some time, but I don't remember it being this difficult to get LAMP up and running.
I've got MySql working (Nextcloud is working), Apache2 seems to be fine, but PHP doesn't seem to be talking to Apache or visa-versa.
I followed the LAMP wiki and it all seemed fine, but when I head to her site, it just tells me "There's been a critical error" with no other information to chase down.
When I check: php -v it gives me PHP 7.4.21 (cli).
apache2ctl -M shows: php7_module (shared)
What am I missing? My vhost file seems to be fine (very similar to the ones I use for my sites at home (Ubuntu Server 21.04).
I looked in /var/log/apache for the error logs, and it looks like Wordpress is looking for PHP but it's not doing what it is asking (I don't understand it all, and I can paste it in here, but there's quite a bit).
Here is the tail results (there's more, this is the first part):
Code: | Thu Aug 12 16:00:37.309417 2021] [php7:error] [pid 3236] [client 114.119.134.35:8996] PHP Fatal error: require(): Failed opening required 'ABSPATHWPINC/sodium_compat/autoload.php' (include_path='.:/usr/share/php7:/usr/share/php') in /var/www/www.watchingskycandy.com/wordpress/wp-includes/compat.php on line 333 |
The file in question (Line 333) has:
Code: | // sodium_crypto_box() was introduced in PHP 7.2.
if ( ! function_exists( 'sodium_crypto_box' ) ) {
require ABSPATH . WPINC . '/sodium_compat/autoload.php';
} |
Any help is appreciated,
Thank you _________________ A Pile of Code (basically dead).
Personal Site (basically useless).
Last edited by 67comet on Fri Aug 13, 2021 5:16 pm; edited 1 time in total |
|
Back to top |
|
|
alamahant Advocate
Joined: 23 Mar 2019 Posts: 3872
|
Posted: Thu Aug 12, 2021 7:05 pm Post subject: |
|
|
Hi
In /etc/conf.d/apache2
do you have php enabled
Code: |
APACHE2_OPTS="..........-D PHP.........."
|
Possibly also fcgi and/or php-fpm depending on how you configured apache.
Also what is the output of
Code: |
cat /etc/apache2/mo*/70_mod_php.conf
|
You also need to be mindful as to what user is php running as and the perms of the webroot directory to allow access to that user. _________________
|
|
Back to top |
|
|
figueroa Advocate
Joined: 14 Aug 2005 Posts: 2894 Location: Edge of marsh USA
|
Posted: Fri Aug 13, 2021 3:56 am Post subject: |
|
|
PHP in make.conf?
Code: | $ grep PHP /etc/portage/make.conf
PHP_TARGETS="php7-4"
|
_________________ Andy Figueroa
hp pavilion hpe h8-1260t/2AB5; spinning rust x3
i7-2600 @ 3.40GHz; 16 gb; Radeon HD 7570
amd64/17.1/desktop (stable), OpenRC, -systemd -pulseaudio -uefi |
|
Back to top |
|
|
hdcg Tux's lil' helper
Joined: 07 Apr 2013 Posts: 119
|
Posted: Fri Aug 13, 2021 5:01 am Post subject: |
|
|
Hi 67comet,
your PHP is already working. Actual problem is the code or more likely it's configuration.
Code: | Thu Aug 12 16:00:37.309417 2021] [php7:error] [pid 3236] [client 114.119.134.35:8996] PHP Fatal error: require(): Failed opening required 'ABSPATHWPINC/sodium_compat/autoload.php' (include_path='.:/usr/share/php7:/usr/share/php') in /var/www/www.watchingskycandy.com/wordpress/wp-includes/compat.php on line 333 |
PHP is running, but fails to include the mentioned file 'ABSPATHWPINC/sodium_compat/autoload.php'. I guess the variables ABSPATH WPINC are undefined and therefore PHP considers them as strings (most likely there is a PHP warning in the log that this is happening) and creates the invalid path.
Next step is to understand why they are not defined. They look like WordPress variables.
Best Regards,
Holger |
|
Back to top |
|
|
67comet Apprentice
Joined: 29 Oct 2004 Posts: 262 Location: Ogden, UT
|
Posted: Fri Aug 13, 2021 4:26 pm Post subject: |
|
|
alamahant wrote: | Hi
In /etc/conf.d/apache2
do you have php enabled
Code: |
APACHE2_OPTS="..........-D PHP.........."
|
|
Yes, it's in there.
Quote: |
Possibly also fcgi and/or php-fpm depending on how you configured apache.
Also what is the output of
Code: |
cat /etc/apache2/mo*/70_mod_php.conf
|
|
Here's what it has:
Code: |
IfDefine PHP>
# The mod_php.so symlink is controlled by
# eselect-php. However, the module name changed from
# php5_module to php7_module so we can't blindly load whatever
# is there. Instead we let eselect-php manage a small
# configuration file that loads the appropriate module.
Include "/var/lib/eselect-php/mod_php.conf"
# Tell apache that mod_php should handle PHP files.
#
# NOTE: Avoiding AddHandler/AddType for security (bug
# #538822). Please read the related news item!
<FilesMatch "\.(php|php[57]|phtml)$">
SetHandler application/x-httpd-php
</FilesMatch>
# PHP source files which are meant to be displayed as
# syntax-highlighted source code.
#<FilesMatch "\.phps$">
# SetHandler application/x-httpd-php-source
#</FilesMatch>
#DirectoryIndex index.php index.phtml
#<FilesMatch "\.(php|php[57]|phtml)$">
#SetHandler application/x-httpd-php
#</FilesMatch>
# PHP source files which are meant to be displayed as
# syntax-highlighted source code.
#<FilesMatch "\.phps$">
# SetHandler application/x-httpd-php-source
#</FilesMatch>
DirectoryIndex index.php index.phtml
</IfDefine>
|
Quote: |
You also need to be mindful as to what user is php running as and the perms of the webroot directory to allow access to that user. |
Not sure what it's running as, I didn't mess with it other than to re-emerge it a few times hoping it'd "fix its self".
Thank you. _________________ A Pile of Code (basically dead).
Personal Site (basically useless). |
|
Back to top |
|
|
Banana Veteran
Joined: 21 May 2004 Posts: 1337 Location: Germany
|
|
Back to top |
|
|
67comet Apprentice
Joined: 29 Oct 2004 Posts: 262 Location: Ogden, UT
|
Posted: Fri Aug 13, 2021 5:16 pm Post subject: |
|
|
figueroa wrote: | PHP in make.conf?
Code: | $ grep PHP /etc/portage/make.conf
PHP_TARGETS="php7-4"
|
|
My make.conf does have php in there under the USE flag, and I un-hashtagged the PHP_TARGETS line.. Recompiled --newuse (world) and php works when I make a simple phpinfo page, but it croaks when I get to the installation of Wordpress (From their download - after I enter the database stuff, it croaks w/no good info - I'll go hit their forums up), looks like this is a Wordpress issue, not a Gentoo issue ( I'm happy about that ) ..
Thank you all again! _________________ A Pile of Code (basically dead).
Personal Site (basically useless). |
|
Back to top |
|
|
figueroa Advocate
Joined: 14 Aug 2005 Posts: 2894 Location: Edge of marsh USA
|
Posted: Fri Aug 13, 2021 5:33 pm Post subject: |
|
|
As a USE flag, php has very limited application.
Code: | $ euse -i php
global use flags (searching: php)
************************************************************
[- ] php - Include support for the PHP language
local use flags (searching: php)
************************************************************
[- ] php
kde-apps/umbrello: Enable PHP import support using dev-util/kdevelop
and dev-util/kdevelop-pg-qt
[- ] (5) 21.04.3 [gentoo]
[- ] (5) 21.08.0 [gentoo]
|
_________________ Andy Figueroa
hp pavilion hpe h8-1260t/2AB5; spinning rust x3
i7-2600 @ 3.40GHz; 16 gb; Radeon HD 7570
amd64/17.1/desktop (stable), OpenRC, -systemd -pulseaudio -uefi |
|
Back to top |
|
|
|