Monday, May 21, 2007

» 002 - Writing a piece of code for Server testing

This blog has PERMANENTLY been moved to Dreamweaver PHP (http://www.dwphp.com)

In the previous part I explained you about how to install Appserv as our server which also supports PHP and MySQL. I believed that you my dear online friends could get through all the processes so easily...

Let's begin with the next lesson for today. After you have Appserv installed, you should notice a directory call "Appserv" which is located in c:\ (by default "c:\AppServ\"). Double click on it and find a folder named "www".

This is where our files for web sites will reside....At this level of directoty, you need not pay attention to other folders. What's necessary for us now is only "www".

In order to test if the server is running quite properly for our development, type in this piece of code in your preferred code editor:

< ?php

echo "Hello guys, finally this is my first time coding.";

?>

Note that "<" and "?php" on the first line should stick together; I'm not able to make them get together in Blogger."

Save it as "lesson01.php" in c:\AppServ\www\

Then open you web browser and type in the following URL:

http://localhost/lesson01.php

You will see the sentence that you just coded earlier on the screen which means that the server seems to work okay, at least for the "echo" command.....lol ("echo" in PHP is like saying "Print these words in the quotes onto the screen.)"

At this point, I guess you could notice how the physical file and URL are related....Think about it this way: to make it simple, I want to you to think that "WWW" folder is like "Main" folder for your website which contain "lesson01.php" and other files.....and in the URL "localhost" is like a "server name/domain name" for our local PHP development test. Recall tutorial no. 001 for more info.

I'd recommend that for some of my dear friends who are just new to PHP (without any knowledge of PHP at all) to grab a PHP book, or visit http://www.w3schools.com/php/default.asp just a couple of days to give you some ideas about PHP so that you won't get confused on what I will demostrate to you in the next few days if some hand codings are required.

I hope, again, that this tutorial doesn't confuse you and give you a big headache...Any comments will be appreciated for my improvement on writing skill!! Thanks


Sunday, May 13, 2007

» 001 - Apache Server/PHP/MySQL/phpMyAdmin Setup using AppServ

Our goal is to be able to run PHP scripts on our own computers for the purpose of dynamic web testing and development. What exactly should you do to get the scripts run properly? Unlike running general HTML scripts in IE or any other browser, running PHP requires some components for the script compilation. The answer to this question is by installing a webserver (Apache), PHP Core, and MySQL (for database-driven websites) on your PC.

However, installing all these components individually on your PC is quite cumbersome for newbies as some complicated configurations will be needed in the process. I'd recommend my dear readers to grab the following package that will install the above components for you in just less than 10 clicks.......Trust me; it's really that simple!


What does the Appserv package have?

  • Apache Server (web server)

  • PHP
  • MySQL (for database-driven web development)
  • phpMyAdmin (one of the most popular tools for administering MySQL databases via its web-based interface)

AppServ Installation Step by Step.


1. Double Click appserv-win32-x.x.x.exe to install AppServ on your computer.




Figure 1 AppServ Welcome Screen


2. License Agreement : AppServ distribution under GNU/GPL License. You must read the license agreement before you install it. If you agree with this license, click Next to go to proceed. If you do not agree, click Cancel to cancel the installation.




Figure 2 GNU/GPL License Agreement screen.


3. Choose Install Location: AppServ default location is C:\AppServ. If you need to change the destination, click Browse botton to change your destination for AppServ program and then click Next to proceed.




Figure 3 Choose Install location screen.


4. Select Components : AppServ's package components are, by default, checked.If you want to choose some components to install. You can click at check box.- Apache HTTP Server is a Web Server.- MySQL Database is a Database Server.- PHP Hypertext Preprocessor is a PHP Programming processor.- phpMyAdmin is a MySQL Database control via WWW. If you complete choosing it, click Next to proceed.




Figure 4 Choose Package Components screen.


5. Apache Configuration : This screen for specify Apache configure.Server Name You must specify Server Name e.g. "localhost". Admin Email You must specify Admin Email e.g. root@appservnetwork.com HTTP Port You must specify HTTP port for Apache Web Server (default = 80).




Figure 5 Apache Web Server configure screen.


6. MySQL Configuration : Root Password You must enter root password for MySQL Database. Default user for this password is root . Character Sets Specify for data storage language and collations. Old Password: If you have problem when you coding PHP code with Old MySQL API., with the error saying "Client does not support authentication protocol requested by server", you should consider upgrading MySQL client. You must check this option to avoid error. Enable InnoDB: If you use InnoDB, you must check this option.




Figure 6 MySQL Database configure screen.


7. Complete AppServ setup : Setup ask to start Apache and MySQL immediately. Click Finish to end this setup and AppServ is prompt to be used.




Figure 7 Complete AppServ Setup screen.


After you're done with the installation, open one of your web browsers and type the following URLs in the address field

You should be able to see The AppServ Open Project x.x.x Welcome Screen. It means that you're done with the installation of the mentioned components.

It was very easy, wasn't it? In the next post, I will show you how to write a simple PHP script in order to test if the server is ready for our future web applications.


Installation Steps - Source: APPSERVNETWORK
revised by SaMsOniZe

Wednesday, May 9, 2007

» Say Hi to the world of PHP and DW Lovers!!!

This is my first blog which I intend to blog all my past experiences that I've had in PHP and Dreamweaver Technology. All the tutorials in my blog are not probably meant for those expert website developers. But instead, my objective for building this blog is to guide newbies who are interested in developing a dynamic website using an open-source web language like PHP, and the most powerful webpage builder like Dreamweaver to follow and understand basic-intermediate syntax of them.

However, the blog hopefully may be useful for those experienced developers in refreshing their memory about PHP and Dreamweaver.

I hope you will enjoy my blog and learn something from it. I'll try to update this blog every two/three days. If you find any area on the blog you think i should improve, you're fully welcome to leave comments here.


Thank you for your visit!