Hi.......Help me get started with PHP

Thread Solved

Join Date: Apr 2009
Posts: 5
Reputation: ramanand is an unknown quantity at this point 
Solved Threads: 0
ramanand ramanand is offline Offline
Newbie Poster

Hi.......Help me get started with PHP

 
0
  #1
Apr 10th, 2009
Guys, i have installed PHP 5 on my windows system, i am able to browse to info.php which shows a listing, but if i create another simple page with a echo statement then i and not able to browse that page. i get the HTTP 500 internal server error. i have both the pages in the same folder.


hepl please
Reply With Quote Quick reply to this message  
Join Date: Apr 2009
Posts: 257
Reputation: BzzBee is an unknown quantity at this point 
Solved Threads: 37
BzzBee BzzBee is offline Offline
Posting Whiz in Training

Re: Hi.......Help me get started with PHP

 
0
  #2
Apr 10th, 2009
make a folder in www directory and put your page in it and try to browse.
Reply With Quote Quick reply to this message  
Join Date: Apr 2009
Posts: 257
Reputation: BzzBee is an unknown quantity at this point 
Solved Threads: 37
BzzBee BzzBee is offline Offline
Posting Whiz in Training

Re: Hi.......Help me get started with PHP

 
0
  #3
Apr 10th, 2009
tell me what happened so i can better guide you.
Reply With Quote Quick reply to this message  
Join Date: Apr 2009
Posts: 257
Reputation: BzzBee is an unknown quantity at this point 
Solved Threads: 37
BzzBee BzzBee is offline Offline
Posting Whiz in Training

Re: Hi.......Help me get started with PHP

 
0
  #4
Apr 10th, 2009
you can make a simple echo file with the name of "index.php" in you folder. so when you will click on your folder listed on first page you will be redirected to index.php page. but if you have file with different name then you have to go that page manually. or type your file name in address bar e.g
http://localhost/mytestfolder/testfile.php

if if your file name is index.php then its enough to right

http://localhost/mytestfolder/
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 238
Reputation: samarudge is an unknown quantity at this point 
Solved Threads: 19
samarudge samarudge is offline Offline
Posting Whiz in Training

Re: Hi.......Help me get started with PHP

 
0
  #5
Apr 10th, 2009
Tizag has some realy great beginer tutorials on PHP (They helped me learn in about 1 month)
Tizag PHP Tutorials
Enjoy
My Blog, Life and everything that matters to me - SamRudge.co.uk

2x Macbook Pro's, 1x Mac Pro, 1x iMac, 2x Macbook's running Fedora linux - In conclusion, I hate windows =)
Reply With Quote Quick reply to this message  
Join Date: Apr 2009
Posts: 5
Reputation: ramanand is an unknown quantity at this point 
Solved Threads: 0
ramanand ramanand is offline Offline
Newbie Poster

Re: Hi.......Help me get started with PHP

 
0
  #6
Apr 10th, 2009
hi,

I have create a new folder for every page? wont it be possible to browse the pages from the single folder.
Reply With Quote Quick reply to this message  
Join Date: Feb 2009
Posts: 9
Reputation: kokoro90 is an unknown quantity at this point 
Solved Threads: 6
kokoro90 kokoro90 is offline Offline
Newbie Poster

Re: Hi.......Help me get started with PHP

 
0
  #7
Apr 10th, 2009
No, you don't have to create a new folder for every page. However, in order for php code to be executed, you not only need to make sure to use the <?php opening and ?> closing tags, but also make sure that the directory is in fact configured as a DocumentRoot in apache (assuming you use apache).
Also you cannot "browse" to it using the filesystem, but need to type in the valid URL for the page, which most likely will be something like this: http://localhost/<directory>/filename.php

It might help if you tell us the directory structure as well as how you configured the DocumentRoot.

Hope this helps...
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 148
Reputation: mschroeder is on a distinguished road 
Solved Threads: 25
mschroeder mschroeder is offline Offline
Junior Poster

Re: Hi.......Help me get started with PHP

 
0
  #8
Apr 10th, 2009
Actually in a purely PHP file, the closing tag ?> should be excluded.

It is necessary when you are jumping in an out of php control structures that are mixed with html or some other kind of output.
If you're question/problem is solved don't forget to mark the thread as Solved!

-- Code I post is usually but not always tested. If it is tested it will be against 5.2.11 or 5.3.0
Reply With Quote Quick reply to this message  
Join Date: Jan 2008
Posts: 57
Reputation: emarshah is an unknown quantity at this point 
Solved Threads: 5
emarshah emarshah is offline Offline
Junior Poster in Training

Re: Hi.......Help me get started with PHP

 
0
  #9
Apr 10th, 2009
If you are working on one website, just one folder will be enough for that website, put all the php, html files and folders regarding that website in that folder.
Create new folder for new website and its related material.
Reply With Quote Quick reply to this message  
Join Date: Apr 2009
Posts: 5
Reputation: ramanand is an unknown quantity at this point 
Solved Threads: 0
ramanand ramanand is offline Offline
Newbie Poster

Re: Hi.......Help me get started with PHP

 
0
  #10
Apr 11th, 2009
hi,

i have put the php.ini in windows folder.
and have set the doc_root to C:Inetpub/wwwroot. this is where i have the two scripts. I have also configured the IIS virtual directory to C:Inetpub/wwwroot. i am able to open a page which has just phpinfo(). the other page has one echo statement and the phpinfo(), but i am not able to browse it. i try to browse it by using the ip address.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the PHP Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC