Score:0

After setting up Apache it's not serving PHP files, but showing the contents of the files instead

tk flag

The error I got is in this url: url in browser: http://localhost/ error in browser: https://justpaste.it/d82bd

What am I missing here?

I copied the file ipconfig.php (given below) from ipconfig.php.example but no luck.

I give permission to the files using this:


cat /etc/systemd/system/php-fpm.service.d/override.conf

ReadWritePaths = /srv/http/ipconfig.php
ReadWritePaths = /srv/http/uploads/
ReadWritePaths = /srv/http/application/logs
ReadWritePaths = /srv/http/vendor/mpdf/mpdf/tmp

 $ ls /srv/http

 application     docker-compose.yml  ipconfig.php.example  uploads
 assets          Gruntfile.js        LICENSE.txt       v1.5.11.zip
 composer.json   htaccess        package.json      vendor
 composer.lock   index.php       README.md
 CONTRIBUTING.md  ipconfig.php       robots.txt

We are on Archlinux

We created a database in mariads as explained in Archwiki

$ mariadb -u root -pa
MariaDB > CREATE DATABASE invoiceplane;
MariaDB > GRANT ALL PRIVILEGES ON invoiceplane.* TO invoiceplane@'localhost' IDENTIFIED BY 'password';
MariaDB > FLUSH PRIVILEGES;

further

$ cat /etc/httpd/conf/extra/invoiceplane.conf
Alias /invoiceplane "/srv/http"
<Directory "/srv/http">
    DirectoryIndex index.php
    AllowOverride All
    Options FollowSymlinks
    Require all granted
</Directory>
$ cat /etc/httpd/conf/httpd.conf

result

$cat /srv/http/ipconfig.php

result

I am sorry but I am a complete newbie but I tried to do as suggested in wiki and docs.

Score:2
ro flag

the "error" you pasted in justpaste.it is not a real error message, but you are seeing the whole index.php file. This means probably that PHP on your server is misconfigured.

Score:1
cn flag

I would do a Google search with the following keywords: apache server not reading php files

It will show that you need to add a handler for PHP files in the Apache config file

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.