You are not logged in.

#1 2023-11-11 20:49:49

jojo06
Member
Registered: 2023-11-04
Posts: 196

[SOLVED!]Apache/httpd problem

I could access the localhost, but it wouldn't run php. Then I did a lot of work, reinstalled, re-configured etc.
I changed the php.init rules, added php in httpd. I also don't have the php version. The last access is gone. httpd can't start. I reinstalled it and reinstalled php but no luck.

systemctl status httpd:

× httpd.service - Apache Web Server
     Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; preset: disabled)
     Active: failed (Result: exit-code) since Sat 2023-11-11 12:38:09 PST; 1s ago
   Duration: 71ms
    Process: 2498 ExecStart=/usr/bin/httpd -k start -DFOREGROUND (code=exited, status=1/FAILURE)
   Main PID: 2498 (code=exited, status=1/FAILURE)
        CPU: 61ms

Nov 11 12:38:09 roses systemd[1]: Started Apache Web Server.
Nov 11 12:38:09 roses httpd[2498]: [Sat Nov 11 12:38:09.982696 2023] [php:crit] [pid 2498:tid 139778901235584] Apa>
Nov 11 12:38:09 roses httpd[2498]: AH00013: Pre-configuration failed
Nov 11 12:38:09 roses systemd[1]: httpd.service: Main process exited, code=exited, status=1/FAILURE
Nov 11 12:38:09 roses systemd[1]: httpd.service: Failed with result 'exit-code'.

httpd:

[Sat Nov 11 12:42:35.443385 2023] [php:crit] [pid 3011:tid 139935533016960] Apache is running a threaded MPM, but your PHP Module is not compiled to be threadsafe.  You need to recompile PHP.
AH00013: Pre-configuration failed

php -v:

PHP Warning:  Module "curl" is already loaded in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'zip' (tried: /usr/lib/php/modules/zip (/usr/lib/php/modules/zip: cannot open shared object file: No such file or directory), /usr/lib/php/modules/zip.so (/usr/lib/php/modules/zip.so: undefined symbol: pcre2_match_8)) in Unknown on line 0
PHP 8.2.12 (cli) (built: Nov 11 2023 12:17:39) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.2.12, Copyright (c) Zend Technologies

php -i | grep Configure:

PHP Warning:  Module "curl" is already loaded in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'zip' (tried: /usr/lib/php/modules/zip (/usr/lib/php/modules/zip: cannot open shared object file: No such file or directory), /usr/lib/php/modules/zip.so (/usr/lib/php/modules/zip.so: undefined symbol: pcre2_match_8)) in Unknown on line 0
Configure Command =>  './configure'  '--prefix=/usr' '--with-config-file-path=/etc/php' '--enable-bcmath' '--with-bz2' '--enable-calendar' '--with-curl' '--enable-exif' '--with-fpm-user=http' '--with-fpm-group=http' '--enable-ftp' '--with-gettext' '--with-gd' '--enable-intl' '--enable-mbstring' '--with-mysqli' '--enable-opcache' '--with-pdo-mysql' '--enable-shmop' '--enable-soap' '--enable-sockets' '--enable-sysvmsg' '--enable-sysvsem' '--enable-sysvshm' '--enable-wddx' '--enable-zip' '--with-zlib' '--with-mhash' '--with-pear'

Is everyone else having this kind of problem or is it because I can't install Arch properly?

Last edited by jojo06 (2023-11-12 11:46:58)

Offline

#2 2023-11-11 21:34:20

jonno2002
Member
Registered: 2016-11-21
Posts: 684

Re: [SOLVED!]Apache/httpd problem

did you follow the arch wiki to install and configure apache and php ?
that error message is clearly detailed under the php section here: https://wiki.archlinux.org/title/Apache_HTTP_Server#PHP

please follow the wiki and let us know if you still get stuck

Offline

#3 2023-11-12 07:32:58

jojo06
Member
Registered: 2023-11-04
Posts: 196

Re: [SOLVED!]Apache/httpd problem

Final Edit i hope:
I solved the access denied issue with editing/adding every <Directory> with this:

    Options Indexes FollowSymLinks MultiViews
    AllowOverride all
        Order Deny,Allow
        Allow from all

But i cant able to upload file to a server. Maybe its the code issue:

Warning: fopen(/file.txt): Failed to open stream: Permission denied in /srv/http/upload.php on line 17
Unable to open file!

After giving all (index.php, file.txt, upload.php) file permissions and setting conf. permissions the problem is solved. Also dont forget the /srv/ and /srv/http/ permissions if anybody reading this while having the same issue. SOLVED!

Last edited by jojo06 (2023-11-12 11:46:43)

Offline

Board footer

Powered by FluxBB