1

Ive have very little in experience in apache, I've been trying to setup the server for local use so I can develop a website to host somewhere else. I need access to php for a variety of things, but after following the guide on Arch apache php libphp it still does not function. Im not following the other sections because i dont need any power user features or extensive speed because its just for a personal website.

66 #LoadModule mpm_event_module modules/mod_mpm_event.so
67 LoadModule mpm_prefork_module modules/mod_mpm_prefork.so

205 #php
206 LoadModule php7_module modules/libphp7.so
207 AddHandler php7-script .php

534 #php
535 Include conf/extra/php7_module.conf

https://pastebin.com/CDAYz5jC is a pastebin with my configuration file as it is lines 66 and 67 are the lines i changed for the first step

lines 206 and 207 are the module and handler

Line 535 is the configuration file for the php7 module php version is 7.4.13, php and php-apache are both installed, using manjaro.

When i run locate php7 it finds the php7_module.conf at /etc/httpd/conf/extra/ it finds libphp7.so at /usr/lib/httpd/modules. This is all it finds.

Basically my website makes an XMLHttpRequest to a php file, and instead of running the php, it just returns the document text. The expect result is that it would actually run the php.

  • 1
    Perhaps a silly question, but it has bitten me before: Are you sure you restarted your server after you made the configuration changes? – RufusVS Dec 06 '20 at 17:55
  • i get that, ive restarted it + restarted my entire computer. permissions are set up right, i really cant figure out why it isnt working. handler is set, php is installed. at the very least it should try to run it and error out, but it isnt. – Karker Carnesir Dec 06 '20 at 18:00
  • And your php file has a .php extension and it is a proper php file when you run it on a working server? Or when you test with the php built in server? – RufusVS Dec 06 '20 at 18:05
  • yes. the file in question is named "about.php" basically its It runs whenever i run it straight with php, apache just refuses. – Karker Carnesir Dec 06 '20 at 18:08
  • You might try: https://superuser.com/questions/284898/how-to-check-which-apache-modules-are-enabled-installed – RufusVS Dec 06 '20 at 18:19
  • in my case its httpd -M. The return value of "httpd -M | grep php" is "php7_module (shared)" You know what, i think i might know what the issue is. i will test and return – Karker Carnesir Dec 06 '20 at 21:18

1 Answers1

1

Nevermind. This wasn't the issue. It seems that for some reason its not running the php when i do an XMLHttpRequest, but does run it if i just run it in my index.html file, regardless, thats a separate issue.

  • it shouldn't interpret your index.html file when its setup to only interpret files ending in .php... – JoSSte Dec 06 '20 at 21:27
  • I think @Karker Carnesir is saying the .php file runs when it is referenced by the index.html file. – RufusVS Dec 07 '20 at 01:36