PHP Problems

free web hosting
Free Web Hosting > Computers & Tech > Programming > Programming General > Misc. Programming Languages

PHP Problems

lonebyrd
O.K. I feel totally computer illiterate right now. I just downloaded PHP 5 with the installer, and I can't get the test page in the tutorial to come out. I was using WAMP but I couldn't figure that out. Let me explain my problem.

When using WAMP, it said to make a directory in the www folder which I did. After doing that, I did a test page from a tutorial in notepad and saved it in that directory then tried to open it using WAMP. That didn't work. Then I tried opening using http://mycomputername/filename/directory and that didnt work.

Now when using the PHP installer, it asks if I want to install with PWS windows 9x or some things called IIS 3,4, or 6. I don't know if I picked the right one. But once again, I did that test page, but when I went to open it, I browsed for something in PHP to open it with and there was nothing.

Shouldn't PHP just come up on the screen normally? Or do I have to open everything in a PHP folder? I'm confused and frustrated and can't get anything to work.

 

 

 


Reply

jlhaslip
First of all, start-up the server and your Browser. Simple so far.
In the Browser Address bar, type in :
CODE

http://localhost/folder/[subfolder/]file_name.php

where the folder/[subfolder/]file_name.php is below the 'server-root' for the local installation.
I have an XAMPP set-up on my machine and the windows file path is something like :
c:/apache/xampp/htdocs/folder/filename, where c:/apache/xampp/htdocs is the server-root, so in my browser I type
CODE

http://localhost/folder/[subfolder/]filename

The stuff inside the square brackets is optional if the file path does not require it.

Reply

Houdini
First off PHP is a server side language like Perl and must be run on a server. All web servers have a ROOT directory (in the case of WAMP I believe it is C:\wamp\www but could possibly be anywhere on your hard drive but the www directory (folder) will reside within the wamp directory folder wherever it might happen to be.

When you write a PHP file it must be placed on the webserver somewhere in the ROOT (www) and you may add subdirectories to this folder for your own organizational purposes. So lets take a simple Hello World script and do just that and then test it.

Create the below file as is and then save it on your hard drive to the www folder or directory (whatever you call it). Then open your favorite browser and type into the address bar http://localhost/hello.php.
CODE
<?php
echo "<center><h1>Hello World from PHP!</h1></center><br />";
echo "My PHP install is working correctly, now for bigger and better things!";
?>
This should ouput to the screen a centered large headline saying Hello World from PHP! and a line with left justification saying My PHP install is working correctly, now for bigger and better things! PHP can generate HTML and that is what the above code does. If after doing the above and the file is in the proper location of the webserver (Apache with WAMP) it should work, otherwise you have a corrupt install and need to uninstall and reinstall the program. Normally with WAMP or XAMPP or Triad and such if you just accept the default values you should have no problems provided that you place the PHP and HTML files in the proper directory.

 

 

 


Reply

Jared
QUOTE(lonebyrd @ Mar 16 2006, 10:49 PM) *
Now when using the PHP installer, it asks if I want to install with PWS windows 9x or some things called IIS 3,4, or 6. I don't know if I picked the right one.


What did you pick? I'm not familiar with the PHP installer, but surely you didn't pick PWS or IIS? If you have WAMP, that means you're using Apache.

W - Windows
A - Apache
M - MySQL
P - PHP

If there was no Apache option, then you can't use the installer (or you just have to update your .conf files manually)... at least that's how it used to be. Last time I used the installer was back in the PHP3/early-PHP4 days...

- Jared

Reply

Feelay
The thing houdini said should work. But if you did NOT create a index.php or index.html page, you can do this ( if you did, try to change the name to something else like test.php [only for testing, it is really recomended that you have an index page in the root folder, but now, just test]).

Try to type this in you web-browser when your server is on.
QUOTE


Now, you should see all the files and folders in the root folder (WWW). Now just search for the folder/file you created and press on it. that should work just fine.

Reply


Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.

Recent Queries:-
  1. using - 75.97 hr back. (1)
  2. file_name php - 81.35 hr back. (1)
  3. instead of htdocs we palced files in www in wamp how? - 88.18 hr back. (1)
  4. php folder in root directory - 216.70 hr back. (1)
  5. php problems in html - 449.73 hr back. (1)
  6. echo php xampp not working - 454.85 hr back. (1)
  7. php file is not working when placed with in subdirectory on iis - 522.87 hr back. (1)
Similar Topics

Keywords : php problems


    Looking for php, problems

*RANDOM STUFF*





*SIMILAR VIDEOS*
Searching Video's for php, problems
advertisement




PHP Problems



 

 

 

 

ADD REPLY / Got an Opinion! a humble request :-) RAPID SEARCH! Free Hosting [X]
Express your Opinions, Thoughts or Contribute your information that might help someone here.
Ask your Doubts & Queries to get answers.. "Together, We enlight each other!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE