|
|
|
|
![]() ![]() |
Mar 17 2006, 04:49 AM
Post
#1
|
|
|
Premium Member Group: Members Posts: 302 Joined: 23-February 06 From: Northeastern Connecticut USA Member No.: 11,487 |
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. |
|
|
|
Mar 17 2006, 10:01 AM
Post
#2
|
|
|
Advanced Member Group: Members Posts: 187 Joined: 15-November 05 From: Inland from the Left Coast of Canada Member No.: 9,627 |
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. This post has been edited by jlhaslip: Mar 17 2006, 10:02 AM |
|
|
|
May 26 2006, 05:12 PM
Post
#3
|
|
|
Super Member Group: Members Posts: 572 Joined: 25-April 05 From: Nashville Tennessee Member No.: 4,340 |
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 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.
echo "<center><h1>Hello World from PHP!</h1></center><br />"; echo "My PHP install is working correctly, now for bigger and better things!"; ?> |
|
|
|
Apr 17 2008, 08:59 PM
Post
#4
|
|
|
Member [ Level 1 ] Group: [HOSTED] Posts: 40 Joined: 17-April 08 Member No.: 29,853 |
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 |
|
|
|
Apr 18 2008, 07:16 AM
Post
#5
|
|
|
Kinda N00B Group: Members Posts: 230 Joined: 13-January 08 From: Sweden Member No.: 27,579 |
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. |
|
|
|
![]() ![]() |
Similar Topics
|
Lo-Fi Version | Time is now: 11th October 2008 - 09:38 AM |