Using Wamp Server for PHP
Hey, I just installed Wamp server on my laptop and everything seems to be running fine, can get into MYSQL and make databases and everything, but I don't know how to use PHP with it. I go into the www folder and make some test PHP and then load it into a browser but it doesn't seem to be reading it as PHP for some reason. I have made sure I have "all services running" not sure if there is something else I am supposed to be doing.
Any help would be appreciated!
Make sure you launch the file via a url (e.g.: "http://localhost/file.php") in the browser address bar, not by double-clicking an icon or via the File->Open menu option. If you just double-click it or such, then it is not being processed by the web server and thus not being routed to PHP for parsing/execution.
"Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
~ Terry Pratchett in Nation
And if you have just set it up make sure the server is 'localhost' , username is 'root' and the password is blank.
Ah yeah I'm dumb, I was just going to the webhost folder and dragging it to my browser. Now when I go through the php admin panel whatever thingy it is all working fine.
Another thing to check. Check the php.ini file via the wamp menu. By default the setting for short_open_tag is set to off which means it wants your php code to be enclosed between <?php and ?>. I left off the php and just used <? ?> so my php code would not run at first. If you want to use <? ?> set the short_open_tag to "On" and restart php. If you always use <?php ?> you can leave the value as "Off".
Anyone know if there is a way to use wamp and IIS at the same time. I installed IIS on my machine and then wamp stopped working. I think there is a way to change localhost port for wamp, but I don't know how.
San Diego Web Development
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)