Problem with web app indexing and PHP

parody
Posts: 6
Joined: Thu Dec 17, 2009 2:34 am
Location: Perth, WA

Problem with web app indexing and PHP

Postby parody » Wed Feb 03, 2010 2:40 am

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?
Amahi 6, x86_64 Fedora 14, Zotac IONITX-B-E min-ITX
Nvidia Ion, Intel Atom N230 1.6GHz, DDR2 1024MB 800MHz, 1TB WD Carviar Green 7200rpm.

User avatar
cpg
Administrator
Posts: 2618
Joined: Wed Dec 03, 2008 7:40 am
Contact:

Re: Problem with web app indexing and PHP

Postby cpg » Thu Feb 04, 2010 10:41 pm

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 2207 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?
My HDA: Intel(R) Core(TM) i5-3570K CPU @ 3.40GHz on MSI board, 8GB RAM, 1TBx2+3TBx1

parody
Posts: 6
Joined: Thu Dec 17, 2009 2:34 am
Location: Perth, WA

Re: Problem with web app indexing and PHP

Postby parody » Sun Feb 07, 2010 11:05 pm

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 2195 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?
Amahi 6, x86_64 Fedora 14, Zotac IONITX-B-E min-ITX
Nvidia Ion, Intel Atom N230 1.6GHz, DDR2 1024MB 800MHz, 1TB WD Carviar Green 7200rpm.

User avatar
cpg
Administrator
Posts: 2618
Joined: Wed Dec 03, 2008 7:40 am
Contact:

Re: Problem with web app indexing and PHP

Postby cpg » Sun Feb 07, 2010 11:10 pm

i don't understand why it would be behaving different than mine.

why not use index.php though?
My HDA: Intel(R) Core(TM) i5-3570K CPU @ 3.40GHz on MSI board, 8GB RAM, 1TBx2+3TBx1

Who is online

Users browsing this forum: No registered users and 22 guests