Web Designing

What you need?

1. HTTP Web server to process the code and deliver the web content. Example: Apache, IIS
2. Server side Scripting language. Example: PHP, ASP,.NET,Perl
3. Client side coding language. Example: Jquery, HTML,CSS, Javascript, Ajax.
4. Database. Example: MySQL, Oracle, IBM DB2.

More details: http://en.wikipedia.org/wiki/Web_development

I have used Apache, PHP, HTML5, CSS3, Javascript/Jquery and MySQL in my example below to setup the environment.

Manually Installing Apache Server on Windows 7
If you have any previous version of Apache (MSI Installer from apache.org) installed on your system, please uninstall it first from Add/Remove program.

Download Apache Web Server from:

http://www.apachelounge.com/download/ - Windows 32bit
http://www.apachelounge.com/download/win64/ - Windows 64bit

For your reference, My Operating System is Windows 7 Professional 32bit, I use "httpd-2.4.3-win32-ssl_0.9.8.zip" for this installation.

To be able to run Apache 2.2 and 2.4 VC10, Visual Studio C++ 2010 SP1 must be installed on our system. Follow the link below to download it, after you've finished downloading the file double click the file to install it.

Ms Visual C++ 2010 SP1 Redistributable Package (x86) - Windows 32bit
Ms Visual C++ 2010 SP1 Redistributable Package (x64) - Windows 64bit

If you want to use Apache 2.2 and 2.4 VC9 you can follow the link from here. .../upgrade-apache-server-to-vc9-version.html

Create a new folder in C Drive name it "Apache" extract the httpd zip file you've downloaded to anywhere on your computer and then copy all files and folders over to "C:\Apache" Navigate to "C:\Apache\conf" folder, double click "httpd.conf" to open it.

Find the Server Root:ServerRoot "c:/Apache24"
Change it to:ServerRoot "c:/Apache"

Next line: Server AdminServerAdmin admin@example.com"
Change it to:ServerAdmin admin@localhost

Next line: Server Name#ServerName www.example.com:80
Uncomment the line and replace www.example.com with localhost:ServerName localhost:80

Next line: DocumentRoot and DirectoryDocumentRoot "c:/Apache24/htdocs" <Directory "c:/Apache24/htdocs">
Change the lines to:DocumentRoot "c:/Apache/htdocs" <Directory "c:/Apache/htdocs">

Next line: cgi-bin Directory<Directory "c:/Apache24/cgi-bin">
Change it to:<Directory "c:/Apache/cgi-bin">

Save the configuration file.

Installing Apache
Now, go to the Start Menu > All Programs > Accessories, right-click "Command Prompt" and then click "Run as Administrator"

Navigate to the Apache's bin folder by typing "cd \apache\bin" in the Command shell and then press Enter, type in "httpd -k install" to install the Apache service and then press Enter. If you got any error displayed here, you should fix them first before you try to start the Apache Server. To start the Apache Server simply type in "httpd -k start" and then press Enter.

For more detail see the image below:

Open your browser and navigate to "http://localhost"

Now you can change your Apache Document Root and Directory to make it easy for you to follow my other tutorials.

Uninstall Apache
In case, if you want to upgrade/downgrade or remove Apache completely from your system follow the steps below.

Open Command Prompt with administrator right (Start Menu > All Programs > Accessories, right-click "Command Prompt" and then click "Run as Administrator") type in "cd \apache\bin" and press Enter, first we will stop the Apache server, type in "httpd -k stop" and then press Enter. Next type in "httpd -k uninstall" to uninstall the Apache Service.

For more detail see the image below:

That's all, you are safe to delete "C:\Apache" folder or replace it with other versions of Apache.

The next step is installing PHP, use PHP VC9 thread safe with this Apache server.

How to install PHP on Windows 7

Before installing PHP you need to install Apache Server first and make sure that it's running properly.

Download the latest version of PHP at http://windows.php.net.
Download the zip version with thread safe as shown below.

Once you've finished downloading the file, unzip it to wherever you want.
Create a new folder in "C:\Apache" name it "php" so the path to the folder is "C:\Apache\php"
Copy all files and folders you've unzipped over to "C:\Apache\php".
In the folder "C:\Apache\php" find and rename "php.ini-production" to "php.ini"
Double click the php.ini to open it and find the following line:doc_root =

Add path to the Document Root, you can find it in your Apache configuration file:doc_root = "D:\My Websites"

Find the next line:; extension_dir = "ext"
Uncomment it and add path to the PHP extensions directory:extension_dir = "C:\Apache\php\ext"

By default PHP uses Windows temp as temporary folder. Once, I got errors in a script while accidentally I emptied the system temp folder. So it's might be a good idea to create a separate temp folder for PHP.

Create a new folder in "C:\Apache" name it "temp" inside the "temp" folder create 2 folders name them "upload" and "session" Now we got 2 new folders, they are "C:\Apache\temp\upload" and "C:\Apache\temp\session"

In the PHP configuration file (php.ini) find the line below:;upload_tmp_dir =
Uncomment it and add path to the upload folder we've just created:upload_tmp_dir= "C:\Apache\temp\upload"

And the next line:;session.save_path = "/tmp"
Uncomment it and add path to the session folder:session.save_path= "C:\Apache\temp\session"

Adding PHP to the System Path.

Open up System Properties, to open it right click My Computer and then click Properties, in the Control Panel Home menu click Advanced System Settings.

In the Advanced tab click on Environment Variables.

In the "System Variable" double click "Path" variable to edit it, add path "C:\Apache\php" into the Variable value, click OK to save the configuration.

The Computer must be restarted to take effect.

Connecting the Apache Server with PHP.
To connect the Apache Server with PHP we need to edit the Apache Configuration file located at C:\Apache\conf\httpd.conf

Find DirectoryIndex as follows:<IfModule dir_module> DirectoryIndex index.html </IfModule>
Add index.php to the line<IfModule dir_module> DirectoryIndex index.html index.php </IfModule>

Add the following lines between <IfModule mime_module> and </ IfModule>ScriptAlias /php/ "C:/Apache/php/" AddType application/x-httpd-php .php .php5 Action application/x-httpd-php "/php/php-cgi.exe" SetEnv PHPRC "C:/Apache/php"

Add the following lines to the end of the httpd.confPHPIniDir "C:/Apache/php/" LoadModule php5_module "C:/Apache/php/php5apache2_2.dll"

If you are using Apache v2.4, change the last line to load "php5apache2_4.dll" module.LoadModule php5_module "C:/Apache/php/php5apache2_4.dll"

You can download php5apache2_4.dll module from http://www.apachelounge.com/download/additional/ in Modules section, after you've finished downloading the file, unzip it and place the file in PHP folder "C:\Apache\php\"

Make sure to download the right version with the PHP currently installed on your system, to check what your PHP version is, open up Command Prompt and type in "php -v" without quotation marks and press Enter.

*** Module php5apache2_4.dll included in PHP v5.4.10+ Binaries (no need to download anymore)

End of update

Restart Apache Server.

Testing PHP.
Open up Notepad, copy and paste the code below:<?php phpinfo(); ?>
Save the file into Apache document root "D:\My Websites" as "phpinfo.php"
Open up browser, in the address bar type in "http://localhost/phpinfo.php" and then press Enter.

If you did it right, you should see something like the image above.

In the next chapter we will install MySQL.

How to install phpMyAdmin on Windows 7

Download the latest version of PhpMyAdmin at http://www.phpmyadmin.net, download the zip version as shown below:

Extract the zip file to the Apache Document Root (D:\My Websites). Rename the folder to "PhpMyAdmin" so the path to the folder is "D:\My Websites\PhpMyAdmin"

In the PhpMyAdmin folder find and rename "config.sample.inc.php" to "config.inc.php"

Open up PHP configuration file located at "C:\Apache\php\php.ini" find the extension below:;extension=php_mbstring.dll

Uncomment the extension to activate it.extension=php_mbstring.dll
Save the file and restart the Apache Server.

Open browser, in the address bar type in http://localhost/phpmyadmin/

At the bottom of the page you might see a warning message about phpMyAdmin configuration storage.

The phpMyAdmin needs a database to store data and information. The database can be imported from the phpMyAdmin installation folder using phpMyAdmin we've just installed.

At the top of the phpMyAdmin window click "Import"

In the "File to Import" browse to "D:\My Websites\phpMyAdmin\scripts\create_tables.sql" and then click "GO" to start importing the database.

If everything was going well a new database called "phpmyadmin" should be appear in the database list and showing a message that the importing database had been successfully finished.

Now open up phpMyadmin configuration file located at D:\My Websites\PhpMyAdmin\config.inc.php, find the lines below:/* User used to manipulate with storage */ // $cfg['Servers'][$i]['controluser'] = 'pma'; // $cfg['Servers'][$i]['controlpass'] = 'pmapass'; /* Storage database and tables */ // $cfg['Servers'][$i]['pmadb'] = 'phpmyadmin'; // $cfg['Servers'][$i]['bookmarktable'] = 'pma_bookmark'; // $cfg['Servers'][$i]['relation'] = 'pma_relation'; // $cfg['Servers'][$i]['table_info'] = 'pma_table_info'; // $cfg['Servers'][$i]['table_coords'] = 'pma_table_coords'; // $cfg['Servers'][$i]['pdf_pages'] = 'pma_pdf_pages'; // $cfg['Servers'][$i]['column_info'] = 'pma_column_info'; // $cfg['Servers'][$i]['history'] = 'pma_history'; // $cfg['Servers'][$i]['tracking'] = 'pma_tracking'; // $cfg['Servers'][$i]['designer_coords'] = 'pma_designer_coords'; // $cfg['Servers'][$i]['userconfig'] = 'pma_userconfig'; /* Contrib / Swekey authentication */ // $cfg['Servers'][$i]['auth_swekey_config'] = '/etc/swekey-pma.conf';

Uncomment the lines to enable them. Change the controluser with "root" and enter your MySql Password./* User used to manipulate with storage */ $cfg['Servers'][$i]['controluser'] = 'root'; $cfg['Servers'][$i]['controlpass'] = 'xxx'; // Enter MySql Password /* Storage database and tables */ $cfg['Servers'][$i]['pmadb'] = 'phpmyadmin'; $cfg['Servers'][$i]['bookmarktable'] = 'pma_bookmark'; $cfg['Servers'][$i]['relation'] = 'pma_relation'; $cfg['Servers'][$i]['table_info'] = 'pma_table_info'; $cfg['Servers'][$i]['table_coords'] = 'pma_table_coords'; $cfg['Servers'][$i]['pdf_pages'] = 'pma_pdf_pages'; $cfg['Servers'][$i]['column_info'] = 'pma_column_info'; $cfg['Servers'][$i]['history'] = 'pma_history'; $cfg['Servers'][$i]['tracking'] = 'pma_tracking'; $cfg['Servers'][$i]['designer_coords'] = 'pma_designer_coords'; $cfg['Servers'][$i]['userconfig'] = 'pma_userconfig'; /* Contrib / Swekey authentication */ $cfg['Servers'][$i]['auth_swekey_config'] = '/etc/swekey-pma.conf';

Save the file and refresh your browser to see the changes, the warning message should be disappear by now.

Update for phpMyAdmin 3.5.+

If you want to upgrade previous version to phpMyAdmin 3.5.+, just delete all files and folders in phpMyAdmin folder except "config.inc.php"

Unzip new phpMyAdmin into phpMyAdmin folder, open up "config.inc.php"

Add the following lines into the storage database and tables./* Storage database and tables */ $cfg['Servers'][$i]['table_uiprefs'] = 'pma_table_uiprefs'; $cfg['Servers'][$i]['recent'] = 'pma_recent';

Save the file, open up your browser, navigate to "http://localhost/phpmyadmin/" and re-import "create_tables.sql" to update phpMyAdmin database and tables, the "create_tables.sql" file can be found in phpMyAdmin's "examples" folder.

I just installed phpMyAdmin 3.56 and found that the sql file is actually in /examples/ in this version; previously it was in /scripts/ Once I figured this out, and that I had to log off and then log back on to get the phpmyadmin settings to work ...

To enable login/logout feature, you can follow the steps below.

Enable phpMyAdmin Login/Logout

In the phpMyadmin configuration file find the line below:$cfg['blowfish_secret'] = ''; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */

Enter a value of your choice$cfg['blowfish_secret'] = 'xaqedtrgiy';
Change the Authentication type with "cookie"$cfg['Servers'][$i]['auth_type'] = 'cookie';

And remove the two lines below or you could just add a double slash "//" in front of them.$cfg['Servers'][$i]['user'] = 'root';

$cfg['Servers'][$i]['password'] = 'xxx'; //Enter MySql Password

Install MYSQL and configure
1. Fixing "mysql error 1364 Field doesn't have a default values":

This is caused by the STRICT_TRANS_TABLES SQL mode defined in the %PROGRAMDATA%\MySQL\MySQL Server 5.6\my.ini file. Removing that setting and restarting MySQL should fix the problem



2. Releasing rowlocks for parallel updates:

c:\ProgramData\MySQL\MySQL Server 5.6\my.ini

Search for innodb_locks_unsafe_for_binlog if not found then add a new entry like below any where in the above file

Configuring PHP for maximum POST method
in php.ini change as below:

max_input_nesting_level = 500
max_input_vars = 5000

No comments:

Post a Comment