Versione di APACHE 2.x, PHP 5.x e Mysql 4.x Apache 2.0 (scaricare dalla sezione httpd) - installazione di default (riempire tutti i campi richiesti PHP 5.0 (scaricare il file .zip) - installazione di default (scompattare e copiare in php dentro alla cartella di apache) MySQL 4.x (scaricare il file .zip) - installazione di default (installazione standard, selezionare tutte le opzioni, ed inserire la password) Dentro APACHE.CONF LoadModule php5_module "C:/Programmi/Apache Group/php/php5apache2.dll" AddType application/x-httpd-php .php # configure the path to php.ini PHPIniDir "C:/Programmi/Apache Group/php" Aggiungere index.php DirectoryIndex index.php index.html index.html.var In PHP rinominare il file php.ini-recommended in php.ini Modificare la riga: ; Directory in which the loadable extensions (modules) reside. extension_dir = ".ext" ; Directory in which the loadable extensions (modules) reside. extension_dir = "C:\Programmi\Apache Group\php\ext" Togliere ; alla seguente riga extension=php_mysql.dll Attenzione: ; Maximum allowed size for uploaded files. upload_max_filesize = 2M ========================================= Versione 2.0 di Apache e PHP 4.x LoadModule php4_module C:/php/sapi/php4apache2.dll AddType application/x-httpd-php .php ***** Il file php.ini va messo in 'C:/windows' ***** ========================================= The target is to attempt to install mySQL , php, & Apache in Windows. (http://internetmaster.com/installtutorial/) We are installing as a sapi module. Contents :: download, install, configure, and test server :: apache :: download, configure, run example script :: php :: download, install mysql, configure, run example script :: mysql Release Notes - updated to 1.3.31(apache) - fixed a few problems with mysql setup. it should be a flawless install. - moved to the next release of mysql - will update phpMyAdmin setup:next few days from sep.25 '04 - adding video tutorials in the near future Downloading Apache The Apache Project is a collaborative software development effort aimed at creating a robust, commercial-grade, featureful, and freely-available source code implementation of an HTTP (Web) server. The project is jointly managed by a group of volunteers located around the world, using the Internet and the Web to communicate, plan, and develop the server and its related documentation. These volunteers are known as the Apache Group. In addition, hundreds of users have contributed ideas, code, and documentation to the project. Currently, I have apache download in .exe format. If you wish to download the .msi format(smaller) then you have to get it from the apache website. .msi format instructions follow below Windows XP Apache Users Read This First If you will install Apache on Windows XP, you must install the Windows XP Service Pack 1. You may obtain that service pack from; here Download Apache version [1.3.31] :: format: exe file :: size: 5.4MB Important: 1) If you are going to install apache in Windows 95 then download and install Windows Socket 2 Update first before proceeding. Available directly from Microsoft server WS2 You can save this files wherever you wish, just remember where to pick them up when needed. :) Note: Because Apache CANNOT share the same port with another TCP/IP application, you may need to stop or uninstall certain services first. These include (but are not limited to) other web servers, and firewall products such as BlackIce. If you can only start Apache with these services disabled, reconfigure either Apache or the other product so that they do not listen on the same TCP/IP ports. You may find the Windows "netstat -an" command useful in finding out what ports are in use. /contact Installing Apache Well, let's locate that Apache exe file and run it. I hope you still remember where you kept it. Server Information Network Domain:- StaticIP, local ip(192.168.0.1), get Static DNS for you dynamicIP(see no-ip.com) Server Name:- 127.0.0.1(localhost), StaticIP, Static DNS(no-ip.com) Administators Email:- your_email@domain.com Finish the install. Configuring Apache Ok, now remember when apache install was on 'Server Information'? We specified localhost as 'Server Name' Apache was configured just to run on default. So lets try it out. For Win9x/2000/xp Click on "Start->Programs->Apache HTTP Server 2.0.47->Control Apache Server-> Start Apache in Console" Apache launches a DOS window then the window is immediately renamed to 'APACHE'. Give it some time to load[patience]. In win98, the windows stays there... so just minimize it. Since we now have the apache executable file not msi, in windows 2000/xp you will have the window appear then disappear. Now, we configured apache. Let's take it for a test. Open you're browser and type http://localhost You should see this after you have typed the address: 'If you can see this, it means that the installation of the Apache web server software on this system was successful.' Well, lets make a little index file for apache to use everytime you are in http://localhost Remember, we will not use the index file until apache is configured for the folder web. -Stop Apache. net stop apache in command or stop apache using the start menu. -First, open the configuration file(httpd) - located in the 'conf' folder of Apache -Search for DirectoryIndex then we will add little extra characters to that line. -Follow the image below. just add index.php and index.htm after index.html -Save and Close the file. -Make a folder named 'web' under your main[c] drive. -Go ahead and add an index file in the 'web' folder in your c drive. -Save the index file as .htm :: .html for .php(we are going to hold until php is installed) -Start Apache. net start apache in command or start apache using the start menu. Downloading PHP PHP is a widely-used general-purpose scripting language that is especially suited for Web development and can be embedded into HTML. ok, another new day. Well, lets get into it. We need to download php but its a zip file and its going to need winzip/winrar/pkunzip/unzip/whatever you have unzip it inorder to use it. Download PHP version [4.3.10] :: format: zip file :: size: approx. 7.2MB lets unzip this file into the folder 'c:\php' Note: When you unzip this file, it drops an extra folder. C:\php\php-blah*. Move the contents of the second php folder to the first one then delete that extra php folder that was created. Configure PHP Go into folder 'c:\php' find file 'php.ini-dist' rename it to 'php.ini' Open the file 'php.ini' using 'Notepad' Under 'Search' click 'Find' or 'Edit' click 'Find' on Windows 2000 or press 'Ctrl+F' then type this 'doc_root' and modify according to the image below. Seven lines after find 'extension_dir' and modify following the image below. Modify the values of this two variables according to the screenshot below: doc_root = "c:\web" extension_dir = "c:\php" -Save and Close the file. -Now, lets move this file to: 'php.ini' to c:\windows -- Win95/98/XP To c:\winnt or c:\winnt40 -- WinNT/2000/XP copy the file php4apache.dll from c:\php\sapi folder to the apache.exe folder By default c:\Program Files\Apache Group\Apache also copy the file php4ts.dll from c:\php to the same apache.exe folder Configure Apache for PHP Open the 'httpd.conf' file that we opened earlier configuring Apache. "Start->Programs->Apache HTTP Server 2.0.47->Configure Apache Server-> Edit the Apache httpd.conf Configuration File" Search for 'DocumentRoot' & 'Directory' Modify the variables to match the following values: DOCUMENT ROOT:"c:/WEB" Go to the line or search for 'AddType application/x-tar .tgz' below that line add the following: -You can cut and paste them. LoadModule php4_module c:/php/sapi/php4apache.dll AddType application/x-httpd-php .php -Save and Close the file. Test PHP If your apache was still running while you configured php then shut it down and restart it. Lets go ahead and test php with a simple line. Open Notepad by clicking 'Start' -> 'Run' then typing 'notepad' Example script in new window. Save the file under 'c:\web\test.php' Open your browser and type this at the location box 'http://localhost/test.php' That sample script displays the date php is running Download MySQL MySQL is the world's most popular Open Source Database, designed for speed, power and precision in mission critical, heavy load use. Download mySQL version [4.0.21] :: format: zip file :: size: 25.3MB The package that you got is a zip file which contains the setup files. You will need to unzip the files so that you can install it. This one is an easy install like Apache. Extract the files to a folder. Double click 'Setup' or just click it and press 'Enter' key. Next -> :: Next -> :: Next -> :: Custom:Next -> :: Next -> :: Finish Starting MySQL Go to 'c:\mysql\bin' double click on 'winmysqladmin.exe' Ok, so it opened a window then asked you for a username & password. Use 'root' for the username, specify a password, and its up and running. winmysqladmin on first execution is added to the startup folder so when you restart your system, mysql will also be up and running too. This is Not your final Password! Configuring mySQL Occasionally I have been getting emails relating to mysqlcc personally. The last version was somehow in beta mode and it failed to work for some of the users others questioned why have two ways to configure and use mysql. I left mysqlcc out and left the rest to be used with phpMyAdmin. Now guess what?.... we are going to configure mysql through coding... thats right. No more of the GUI configuration. Lets Go! -Start->Run -enter command prompt -type command for win95/98 -otherwise type cmd -type cd \ and press enter -cd c:\mysql\bin -type mysql -u root -p -password: blank(press enter) -type use mysql; -type SELECT User, Host FROM mysql.user ORDER BY User; -you get this as a table blank user ---- localhost blank user ---- build root user ---- localhost root user ---- build -type \quit -Save the following file in the mysql\bin folder as unroot.txt you will need this txt file to complete the command below unroot_text_file -since your username and password[blank] is active you are going to log in with it to execute a script. -type this in command prompt mysql -u root -p mysql < unroot.txt password: blank [press enter] -Attempt to login into mysql. we flushed everything except for root user with password blank mysql -u root -p password: blank [press enter] -type this GRANT ALL PRIVILEGES ON *.* TO 'your_username'@'localhost' IDENTIFIED BY 'your_password' WITH GRANT OPTION; -then quit \quit BEFORE YOU PROCEED, THE PASSWORD YOU USE ABOVE WILL BE THE SAME YOU USE BELOW FOR THE SCRIPT!!! THIS IS ALSO THE SAME PASSWORD YOU WILL USE FOR phpMyAdmin!!! I WILL NOT REPLY TO EMAILS THAT LEAD ALONG THIS LINE : ERROR 1045: Access denied for user: 'your_user@localhost' (Using password: YES) UNDER NO CIRCUMSTANCES!!! Copy the following code into 'notepad' and save it as 'c:\web\test_mysql.php' testing mysql Run 'http://localhost/test_mysql.php' -executing the script for the first time will display the value of 1 -the reason being that mysql_query function only returns a true or false result -the second time you run the script you will get this Table 'testtable' already exists results above will acknowledge mysql is running. Downloading phpMyAdmin 2.5.4 Download phpMyAdmin version [2.5.6] :: format: zip file :: size: 1.9M Note: We are only configuring phpmyadmin for intranet use(personal use). nothing complicated, just to get it going thats all. Do not use this information here to further run or to configure your server. -Unzip the files to 'c:\web'... notice that the files were thrown 2 folders down. go inside -- 1 folder down then move folder 'phpMyAdmin-2.5.4' upto 'web' and rename it to 'phpmyadmin' Configuration --Open the 'config.inc.php' -- using notepad, html editor --Search for $cfg['PmaAbsoluteUri'] and type under the quotes this address. http://localhost/phpmyadmin/ $cfg['PmaAbsoluteUrl'] = 'http://localhost/phpmyadmin'; -Port number would be 3306 -Password would be what you specified earlier $cfg['servers'][$i]['port'] = '3306'; $cfg['servers'][$i]['password'] = 'mysql_password_here'; -Type this in your browser 'http://localhost/phpmyadmin'