Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PHP pages won't load into the browser

Status
Not open for further replies.

Fujiko

Programmer
Dec 23, 2001
63
PH
Hi,

i have no idea why my php pages won't load on the browser. I have uploaded it in the correct directory but it wont show up, what do you think is the problem? do you think my webserver is not recognizing my php files?? please help me out and if it is my server, can you tell me what can i do to restart or run php on the server?? thanks a lot
 
Do you run that particular server? or is it hosted somewhere?

Also, what error number are you getting? 404? If it's a 404 then you dont have that address to the page correctly double check the extension and make sure its just php and not .php.txt as some text editors add this and windows then hides the .txt part.

oooo the joys of windows.
 
yes i run that webserver, i have full access. i just have no idea why its not loading. my file is .php and its uploaded to my public_html folder
 
Did you install PHP on the web box? I assume your running apache. It's been a year since I messed with apache so bear with me. In your httpd.conf file check out your mapings. Make sure your server knows how to handle php files.

What error are you getting when you try to access your files? This is an important step into finding the answer.

Also, if you didn't install php it's not installed by default. will have the install.
 
its 404 error, ill be checking if the php is properly installed thanks so much.. please bear with me as well hehe, im fresh, newbie, stupid hehe, my first time to mess with apache
 
Ok, if it's a 404 lets solve that problem first.
Check your httpd.conf file for the path to your html files. Make sure it's what ever dir your putting your files in.
Next, create a basic hello world html page, nothing fancy, hust hello world. Try to access that. If you can't we know your putting your files in the wrong place.
If it comes up, then do a ls -la in that dir, this will list the contents and their entire file name. Make sure you dont have any .txt after your file names.
Try that and get back to me :) good luck
 
(i dont know if i understand you but here is the path of document root)

i found DocumentRoot /usr/local/apache/htdocs
then i also found userdir public_html (this is where i upload my pages)

i was able to load the basic hello world.
i did the ls -al and it listed everything.
 
I've enever been able to get the userdir option to work.
Can you copy past the ls -la results to here?
 
total 636
drwxr-xr-x 7 root root 4096 Nov 20 11:41 ./
drwxr-xr-x 13 root root 4096 Nov 16 15:30 ../
-rwxr-xr-x 1 root root 130 Nov 14 23:24 access.conf*
-rw-r--r-- 1 root root 348 Nov 16 01:37 access.conf.default
lrwxrwxrwx 1 root root 3 Nov 14 23:24 etc -> etc
-rw-r--r-- 1 root root 49274 Nov 20 02:26 httpd.conf
-rw-r--r-- 1 root root 48816 Nov 20 02:26 httpd.conf-
-rw-r--r-- 1 root wheel 44241 Nov 18 05:54 httpd.conf.backup
-rw-r--r-- 1 root root 41867 Nov 16 15:30 httpd.conf.bak
-rw-r--r-- 1 root root 49234 Nov 20 02:26 httpd.conf.bytes
-rw-r--r-- 1 root root 37361 Nov 14 23:33 httpd.conf.checkallowoverride
-rw-r--r-- 1 root root 44574 Nov 16 01:37 httpd.conf.default
-rw-r--r-- 1 root root 39181 Nov 15 01:58 httpd.conf.phpopenbasect
l
-rw-r--r-- 1 root root 37381 Nov 14 23:33 httpd.conf.suexec
-rw------- 1 root root 46299 Nov 19 02:49 httpd.conf.tmpeditlib
-rw-r--r-- 1 root root 1319 Nov 16 15:30 httpd.conf.tmpeditlib.skip
-r--r--r-- 1 root root 55399 Nov 20 02:26 httpd.conf,v
-rw-r--r-- 1 root root 12965 Nov 14 23:20 magic
-rw-r--r-- 1 root root 12965 Nov 16 01:37 magic.default
-rw-r--r-- 1 root root 14979 Nov 14 23:20 mime.types
-rw-r--r-- 1 root root 14979 Nov 16 01:37 mime.types.default
-rw-r--r-- 1 root root 5 Nov 16 01:49 php.version
-rwxr-xr-x 1 root root 357 Nov 14 23:24 srm.conf*
-rw-r--r-- 1 root root 357 Nov 16 01:37 srm.conf.default
drwxr-xr-x 2 root root 4096 Nov 14 23:20 ssl.crl/
drwxr-xr-x 2 root root 4096 Nov 16 01:37 ssl.crt/
drwxr-xr-x 2 root root 4096 Nov 14 23:20 ssl.csr/
drwx------ 2 root root 4096 Nov 14 23:20 ssl.key/
drwxr-xr-x 2 root root 4096 Nov 14 23:20 ssl.prm/
 
ooopps my bad, im inside a different folder hehe (stupid me)

here are the contents of my public_html folder when i did the l -al
total 12
drwxr-xr-x 3 root root 4096 Nov 14 23:24 ./
drwxr-x--- 10 root root 4096 Nov 20 11:41 ../
drwxr-xr-x 2 root root 4096 Nov 14 23:24 cgi-bin/
 
Your files arn't in there. Where did you do the hello world html file?
 
i erased my hello world after i tested it. btw, my php files are inside sgb folder, but its funny, i can't seem to find my sgb folder, when i ftp, i created that folder and my files are inside it... when i access thru shell it wont come up. Btw, the server im into, there are other websites being hosted as well.. (this info might help)

i have uploaded again the hello.html

you may view this by typing
 
i got it, i know the directory now =) im really sorry if im so vague, i have no idea about this shit, though i know a bit of it =) here is the folders inside my directory

4096 Nov 19 21:10 ./
4096 Nov 20 02:26 ../
14 Nov 20 10:23 .lastlogin
4096 Nov 16 03:21 mail/
4096 Nov 16 03:21 public_ftp/
4096 Nov 20 12:04 public_html/
4096 Nov 16 03:27 tmp/
4096 Nov 20 09:11 .trash/

Inside public_html i have:

4096 Nov 20 12:04 ./
4096 Nov 19 21:10 ../
4096 Nov 19 22:14 cgi-bin/
101 Nov 20 12:04 hello.html
0 Nov 19 20:56 .htaccess
4096 Nov 16 03:21 mail/
4096 Nov 20 10:31 sgcb/


my php files are inside sgcb folder =)im really sorryy if i make this so hard to understand... =(
 
not hard to understand at all :)

Ok, I was able to pull up your sgcb directory and saw all your files so the userDir option is correct ::whew:: one less problem.

Are these PHP files calling other files? If so that may be your problem, your using the full system path and not the URL path.
 
yes, it calls other files.oh, so i gotta use the url path? that causes my page not to display and gives me the error 404?
 
Probably, I'm not a huge PHP guy but I know in ASP if you request a file that doesnt exist it yell and screams...then doesnt load the page.

Did you read the readme? I looked over it and it seems pretty decent as readmes go.
 
writing some error-handling code into the php can help diagnose problems.

<marc> i wonder what will happen if i press this...[pc][ul][li]please give feedback on what works / what doesn't[/li][li]need some help? how to get a better answer: faq581-3339[/li][/ul]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top