Alternamaton Posted May 29, 2007 Share Posted May 29, 2007 Over the past several hours I've tried installing WAMP, XAMPP, MySQL, Apache, and PHP by themselves, and now just MySQL and PHP (Apache wasn't working). Each time, I uninstalled everything before trying again. I'm at my wit's end. Every time I try to get set up, something doesn't work. I'm so frustrated because I haven't even gotten off the ground and I'm already floundering. I just downloaded and configured MySQL and PHP (when I configured PHP I elected not to set up a server, since I don't have Apache installed; I just want to try some scripts on my own computer, for Christ's sake!). I was going through a tutorial on using PHP and MySQL together and the very first exercise was to create a .php file in Notepad to see if everything was installed correctly. So I ceated the following file: <?php phpinfo(); ?> and saved it as test.php. I then opened it in Firefox and got a blank page. So I tried the following: <html> <head> </head> <title> </title> <body> <?php print "Hello, world!"; ?> </body> </html> Still nothing. So I moved the file from the folder it was in to C:\Program Files\PHP Still nothing. Why is this not working? Quote Link to comment https://forums.phpfreaks.com/topic/53369-very-frustrated/ Share on other sites More sharing options...
Diego17 Posted May 29, 2007 Share Posted May 29, 2007 and saved it as test.php. I then opened it in Firefoxyour firefox is displaying file:///C:/.../test.php or http://localhost/test.php? file:///C:/.../test.php won't work. You must get the page from a php confgured webserver. Quote Link to comment https://forums.phpfreaks.com/topic/53369-very-frustrated/#findComment-263735 Share on other sites More sharing options...
Alternamaton Posted May 29, 2007 Author Share Posted May 29, 2007 But PHP is installed on my computer. I can't use PHP scripts on my own computer, which has PHP installed? Why not? Why does it have to be sent to a "PHP configured server" to work? It's installed on my own computer. Quote Link to comment https://forums.phpfreaks.com/topic/53369-very-frustrated/#findComment-263944 Share on other sites More sharing options...
per1os Posted May 29, 2007 Share Posted May 29, 2007 You can use PHP to do scripts via command line. But in order for them to "work out of the box" they have to work in conjunction with a server to display to the end user. The Apache Server provides away for the script to be interpreted. Much like you cannot run an Excel file without Microsoft Office Excel installed, even though Microsoft Office installed. You have to have PHP running under Apache or IIS to work. If apache than the .php file you are trying to run needs to be located under htdocs and you have to call it from Localhost. Just how it is. I am sure there is a way you can write a command line interpretor for the php file to make it run without apache on your system, but that would mean custom C++ code etc. Apache is alot easier than that. Apache is very easy to setup, especially Apache 2. There is only one part you need to modify in the httpd.conf to get php running and that is adding it as a module or cgi binary. It took me a long time to figure out how to properly setup apache and php and mysql and get them to work, but once you know how you wondered what was the problem in the first place. Read the installation notes etc, they help a ton. Quote Link to comment https://forums.phpfreaks.com/topic/53369-very-frustrated/#findComment-263952 Share on other sites More sharing options...
Alternamaton Posted May 29, 2007 Author Share Posted May 29, 2007 Ugh, I feel like just reinstalling Windows. I can't get Apache to work, and I just scanned my computer with a free antivirus program and it found 18 "threats" on my computer. My system is pretty much FUBAR, I think. Stuff (i.e., Apache, MySQL, etc.) just doesn't work for apparently no reason. Quote Link to comment https://forums.phpfreaks.com/topic/53369-very-frustrated/#findComment-264245 Share on other sites More sharing options...
wildteen88 Posted May 30, 2007 Share Posted May 30, 2007 But PHP is installed on my computer. I can't use PHP scripts on my own computer, which has PHP installed? Why not? Why does it have to be sent to a "PHP configured server" to work? It's installed on my own computer. Its because PHP is a a server-side programming language. It is not a client-side language. Web browsers (such as IE, FireFox, Opera etc) can only understand client-side languages. Examples of client-side languages are HTML, CSS and Javascript etc. Whether you have PHP installed on its own on your computer the browser still doesn't know what the hell it is. However it will think its XML. XML is another type of client-side language. It will only think this due to PHP's tags being very similar to XML's tags. As they both start with the same two characters (<?) and end with the same two characters (?>), eg PHP's tags: <?php and ?> XML's tags: <?xml ?> The easiest and fatsted way of getting PHP setup with Apache is to use the WAMP package from wampserver.com. When you have it installed you must save your .php files and any other files that you link to within that .php in C:/wamp/www - not in your My Documents folder or any other place. It must in WAMP's www folder. Then you open your web browser and go to http://localhost/ OR http://127.0.0.1/ - before going to that address make sure WAMP is running. By having at the taskbar and looking for the WAMP taskbar icon - see the image at the bottom of this page to see what it looks like. Quote Link to comment https://forums.phpfreaks.com/topic/53369-very-frustrated/#findComment-265047 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.