ATTENTION: Follow this only if you want t use your computer as a server over the Internet was well without the hefty instal sizes of servers such as Apache.
So you want to learn PHP do you?
great! Good choice =D
Already wrote your first script, named the file index.php but when you try and view it - nothing.
Oh dear ... looks like all those millions of boffs all over the Internet forgot to mention that sometimes your computer does not have php viewing enabled on it, so you just can't view your test pages!
Never fear! Davy's here!
1. Installing the local machine client thingy
PHP must usually be served remotely from a server with PHP installed on it already, but seeing as you are just learning PHP and want to test your PHP files without having the purchase hosting, you need to fool your computer into behaving like a remote server and to deliver those files to your browser.
Enter
BadBlue
If you go to their
website you can downlaod the program for free. Install it. You should know how to do this, if not, shut your computer down and go to your local college to learn how to use a computer first. For beginners. PHP is not for beginner PC users.
2. Installing PHP components
Secondly you need to give your computer the components that a server would normally use in order for our BadBlue software would use to deliver those php pages on a silver browser plater. Luckily for you newbie php developers out there that PHP is Open Source and free. Very cheap to those with problems in believing things are free. No, really.
The components can be found within the BadBlue program itself by following this path within the program:
Click the 'Help' tab.
Under the 'for developers' title, click 'Install PHP'.
Follow the built-in wizard.
Test that PHP works now for local viewing, follow the above path of clicking but for click 'Test PHP' instead of 'Install PHP'.
Setting up BadBlue
Okay so your mostly ready. How do you see your files - you double click your file directly but it doesn't work still - it opens up in notepad / dreamweaver / frontpage / randomProgram.exe
BadBlue allows people to view select files and folders over the Internet direct to your PC but you don't need to worry about this if you just want to test your PHP pages. You don't even need to set up a DNS domain name. Your local IP address is all you need.
Your local address wil always be:
http://127.0.0.1/
Click that link.
Whoa see that?!! It loaded straight to the BadBlue startup webpage. But still...it is not helping you veiw your PHP pages. You need to designate the folders you want to view.
Follow this click path within
http://127.0.0.1/ :
Click the 'Manage' tab.
Under the 'Sharing Files' title, click 'Setup Folders Tab'.
Fill in the on screen form fields including the virtual folder name and path. Don't change the other settings because you don't know what they mean yet. You do NOT want this folder to be hidden because that would be useless to you!!
Done it? Good. Now try going to
http://127.0.0.1/
Still doing the same redirecting thing isn't it? It keep directing you back to the BadBlue startup webpage. This is because you haven't pointed your browser towards the actual folder you've selected to be viewed. Try entering it after the forward slash at the start of
http://127.0.0.1/
You should be presented with another BadBlue interface but this time you should be facing the files that are in your designated virtual folder. This would probably be your index.php file you tried viewing before reading this tutorial.
Click the file.
Works now, see? =D
Any queries, comments, quesitons, suggestions or kicks-in-the-pervervial gonzolas, please feel free to contact me in the forums.