Page 1 of 1

Problem with web app indexing and PHP

Posted: Wed Feb 03, 2010 2:40 am
by parody
I 'm currently teaching myself PHP and to test them out I've made a web app called 'mysite' and I put my websites into the /var/hda/web-apps/mysite/html/ file. I also recursively changed the group of mysite to 'users'. (I copied the owner and premissions layout from the homeinv app)

I would like to go to 'mysite' and browse the directory to find the page I would like to load, but when I type in 'mysite' into the url is comes up with the page 'Test Page for the Apache HTTP Server on Fedora', and if I go to a directory like 'mysite/images' it comes up with the directory contents titled 'Index of /images'.
Who an I able to browse the initial directory 'mysite'?

Also if I go to a PHP file it opens up but without the PHP script proccessed. How do I enable PHP on the web app?

Re: Problem with web app indexing and PHP

Posted: Thu Feb 04, 2010 10:41 pm
by cpg
webapps are the perfect thing for learning php and web development!

i just tried this: create a webapp called mysite. when i go to http://mysite i see an empty index:
empty-index.png
empty-index.png (14.57 KiB) Viewed 2217 times
i can create files in /var/hda/web-apps/mysite/html (as root, just to not bother with permissions right now) and see them in the browser.

i can do this:

Code: Select all

echo "<?php echo phpinfo(); ?>" > test.php
and i see a file test.php. when i click on test.php, i see the trillion php settings. not the code.

maybe you have a permission issue?

Re: Problem with web app indexing and PHP

Posted: Sun Feb 07, 2010 11:05 pm
by parody
I deleted mysite and remade the web app so it went back to its defaults. Now PHP works but I'm still not able to look at the root directory.
URL: http://mysite/ comes up with;
Fedora Test Page.JPG
Page displayed when accessing root directory without any type of index page
Fedora Test Page.JPG (67.82 KiB) Viewed 2205 times
I tried removing the index pages of other web-apps and the Test page come up as well. When I actually read the Test page it said, edit /etc/httpd/conf.d/welcome.conf when the index page is not present. And in here it has Options -Indexes. Commenting out this line I'm now able to view the root directory, but is this advisable or should I add a new <Location Match ...> or option so it only works for mysite?

Re: Problem with web app indexing and PHP

Posted: Sun Feb 07, 2010 11:10 pm
by cpg
i don't understand why it would be behaving different than mine.

why not use index.php though?