Ask Your Question
0

Apache issue (Fedora 23)

asked 2015-11-16 02:02:27 -0600

jbrines gravatar image

updated 2015-11-16 17:22:16 -0600

mether gravatar image

Hi Guys,

I am having issues with my Apache and PHP install on my Fedora 23.

When I go to http://localhost I just get a list of folders/sites and php files.

If I click on one of the PHP files it just goes to a blank page. If I click on one of the folders (owncloud) it takes me to an index.php file and shows code.

I have removed httpd and php and reinstalled them and still the same.

I would have though if I went o http://localhost I would get the Fedora Test Page.

John.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2015-11-16 04:10:22 -0600

cobra gravatar image

updated 2015-11-16 04:37:10 -0600

I think your problem is that the Apache config doesn't normally turn on index.php by default, it seems to be restricted to index.html these days.

If you edit the file

/etc/httpd/conf/httpd.conf

and find the line that says

DirectoryIndex index.html

change it to say

DirectoryIndex index.php index.html

save the file out and from the command line (with root privilege, either by su or sudo) execute

systemctl reload httpd.service

it should resolve this for you. Note that you could apply this on a site-by-site basis if you're using Apache Virtual Hosts, take a look at the config files in /etc/httpd/conf.d/

edit flag offensive delete link more

Comments

I added "DirectoryIndex index.php index.html" as it wasn't there at all. Restarted httpd but still the same!

jbrines gravatar imagejbrines ( 2015-11-16 12:25:23 -0600 )edit

Do you have php installed? What is the output if you run rpm -qa | grep php?

cobra gravatar imagecobra ( 2015-11-17 04:03:52 -0600 )edit

Yes as I removed https and php and then installed them again. In fact I have used the DNF reinstall command as well.

jbrines gravatar imagejbrines ( 2015-11-18 01:21:47 -0600 )edit

What output do you see if you temporarily replace your index.php file with one which contains:

<?php phpinfo(); ?>

You should get a breakdown of the installed version of php. If not then Apache may not be enabling it.

cobra gravatar imagecobra ( 2015-11-18 04:26:33 -0600 )edit

It tries to download the php file. I have also tried it with Cherokee and get the same issues. I am convinced it is to do with PHP not working properly but I am no expert.

Is there other ways to test to see if PHP is running or working?

jbrines gravatar imagejbrines ( 2015-11-24 01:27:22 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2015-11-16 02:02:27 -0600

Seen: 464 times

Last updated: Nov 16 '15