Welcome Guest ( Log In | Register )



 
Reply to this topicStart new topic
> PHP Problems
lonebyrd
post Mar 17 2006, 04:49 AM
Post #1


Premium Member
Group Icon

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.
Go to the top of the page
 
+Quote Post
jlhaslip
post Mar 17 2006, 10:01 AM
Post #2


Advanced Member
Group Icon

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
Go to the top of the page
 
+Quote Post
Houdini
post May 26 2006, 05:12 PM
Post #3


Super Member
Group Icon

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
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.
Go to the top of the page
 
+Quote Post
Jared
post Apr 17 2008, 08:59 PM
Post #4


Member [ Level 1 ]
Group Icon

Group: [HOSTED]
Posts: 40
Joined: 17-April 08
Member No.: 29,853



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
Go to the top of the page
 
+Quote Post
Feelay
post Apr 18 2008, 07:16 AM
Post #5


Kinda N00B
Group Icon

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.
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. Problems With New Computer(10)
  2. Problems Using Usb Devices(7)
  3. Problems Installing Vista(14)
  4. Image Problems With Windows 2000(9)
  5. Screensaver Problems(11)
  6. Gimp: Saving As... Issues(3)
  7. Wamp Server Problems(4)
  8. Nero Problems(28)
  9. Office 2007 Document Problems(12)
  10. Internet Connection Sharing Problems(2)
  11. Updating Graphics Card Problems(11)
  12. Freebsd Burning & Installation Problems(4)
  13. Two Problems.(5)
  14. Existing Problems(4)
  15. Networking Problems(4)
  1. Email Problems(5)
  2. Connection Problems(9)
  3. Web Browser And Taskbar Problems (web Browser Disappears)(7)
  4. Installation Gone Bad...(14)
  5. Windows Problems "new Series"- Xp Home Edition Activation Issue(6)
  6. Problems With Php Saving Data Into Mysql(6)
  7. User Authentication Session Handling Problems(14)
  8. Hitman: Blood Money(8)
  9. Firefox Problems..(6)
  10. External Hard Disk Problems(11)
  11. Php Problems(1)
  12. Focus() And Select() Problems With Firefox(2)
  13. Mysql Build/install Problems(4)
  14. Gimp 2.4 Font(2)
  15. Problems With FTP(18)


 



- Lo-Fi Version Time is now: 11th October 2008 - 09:38 AM