Notes below will guide you to install PHP with the database and webservernya. Mainly used here is the software available for free download uintuk so that anyone who has internet access can obtain it. To make you, all the installer PHP, Apache, MySQL, and PostgreSQL is also mentioned here have also been included in the MWCD 02.
To run the PHP system, required three components. The first is the webserver, because the programming language PHP is a server-side (executed on the server). The second is the PHP program itself. This program will process the script, PHP script, so that we can run out and the results. PHP programs can be a stand-alone program or as a module on the web. The third is a database server. This is not mandatory, but very commonly used with PHP, we save the data to be processed and visitors.
Now we will install the three. The sequence is a general webserver, database server, the new PHP.
1. Platform
First, you want to specify the first run on the platform PHP system. PHP is very portable and runs on various OS: has recorded no less than Windows, Unix (Linux, FreeBSD, Solaris, and the names of other Unix systems that may be foreign in your ear), Macintosh (including the latest OS X), OS / 2 , and VMS. Webserver and database server is also running on Windows. You also even later, if desired, can run the database server and webserver + PHP engine on two different OS.
If you're like most people who have only one computer / partition Windows OS, to the number 2. If you want to try, try, or already have Linux, the number 3. If another OS, number 4.
2. Windows
Apache, PHP, and MySQL can run on Windows 95/98/ME, NT, and 2000/XP. Now, you will select the next: the easiest way to use PHPTriad with the third component will install PHP, Apache, and MySQL (Perl plus bonus) at a time or to install each component separately. The first advantage is: easy, it only takes two minutes. Advantage both ways: You can learn more menditel installation and can choose to use the webserver / database other than Apache / MySQL.
If you choose the first way, to the number 5. If the second way, the number 6.
3. Linux
Note: this guide will only Red Hat Linux. In addition, this guide mengasumsikan you have root access. Both Apache, PHP, MySQL installed by root is not necessary, but for ease of discussion, the installation disinggung only by root.
There are several options how to install in Linux, depending on the distribution used, but generally with the binary RPM, or directly from the source. Benefits of the first, fast and practical. Benefits of a second, you can set the webserver configuration in more detail and learn more about the development of Apache / PHP / MySQL.
If you want to install from binary RPM package, to the number 7. If you want to install from source, to the number 8.
4. Operating System Other
Sorry, not covered in this guide. If you use FreeBSD, we can see from the FreeBSD ports collection. If using Unix, you can mengkompile Apache, PHP, and MySQL source code. If using QNX, do not forget to read the INSTALL instructions in the PHP distribution.
Done. For the number 99.
5. Package PHPTriad (easiest, 2 Minutes)
PHPTriad for Windows is a package that includes Apache, MySQL, PHP, and Perl. All you need to start trying to play with PHP.
The first step: Click the software> All packages> phptriad CD from the main menu and download the installer file. EXE that. Or download the installer from PHPTriad www.phpgeek.com.
Step two: After downloading, run the instaler with a double click or enter. Then press the button to approve the agreement. Instaler akan extract all the files to complete. Press the button Close.
Step three: You will now see the Program Group in the Start Menu PHPTriad. Select the Start menu Apache. A text window will appear titled "Apache/1.3.x (Win32) running ..." Do not close this window, unless you want to ignore Apache. During play with PHP, you will need to continue to Apache. Apache only minimize this window. At this stage, you can try actual PHP script. But we will run a MySQL first.
Four steps: Run MySQL by selecting Start Menu> Programs> PHPTriad> Start MySQL. The same text appears akan ago lost in a few seconds. However, the MySQL server is running, you can check in Task Manager.
Step five: Check the Apache open a browser and type in the address http://localhost. If any posts appear with the "Welcome to the PHPTriad ..." then the installation was successful.
Step six: Check MySQL PHPMyAdmin by clicking on the link at the bottom of the Welcome page. If you see any posts with a frame page "Welcome to phpMyAdmin 2.xx ..." then the installation was successful.
Configuring apache is in the c: \ apache \ conf. You put a script in PHP-scripts c: \ apache \ htdocs. MySQL database connection parameters: username = 'root', host = 'localhost', password =''(empty string). You have to wait to give the user MySQL password mySQLadmin with this program. See the MySQL manual for more information.
Later on, every time you want to play with PHP, used to run Apache and MySQL is as above. On NT/2000/XP, both can be run automatically when the computer is turned on, but not described in this guide. Please see the guidelines of PHPTriad.
Done. For the number 99.
Problem:
* If the window in the third Apache lost after a few seconds, or in the fifth step you will not get a page Welcome PHPTriad, it is possible that the webserver is running, such as IIS. The solution, first cut the IIS. In Windows 2000/XP, do the following: select Start Menu> Programs> Administrative Tools> Services. Log In Stop on the World Wide Web Publishing Service.
* If MySQL is missing windows in the four-step after a few seconds, but in six steps that failed to display any posts, and "Warning: MySQL Connection Failed ..." then failed to run MySQL. Try running MySQL manually. How: select Start Menu> Run and then type c: \ apache \ mysql \ bin \ mysqld - console. You will see a text window open and any posts appear "ready to connect." But do not close this window, simply diminimize.
6. Apache Webserver on Windows (5-10 minutes)
We will install the first component: the webserver. There are several options webserver on Windows, free and commercial. Windows NT/2000/XP even have IIS webserver by default. However, this guide will only discuss the Apache. The benefits of using Apache: relatively safe, available in Windows and other platforms (so you can easily adapt in a different environment), and very popular (so you can easily find each other Apache users and ask them).
The first step: Click the software> All packages> apache CD from the main menu and download the installer file. MSI is. Or download the installer from the Apache httpd.apache.org. Note: if you use Windows for this (95/98), then you should download the Microsoft Installer package from the site before you can run the Microsoft file. MSI.
Step two: After downloading, run the instaler with a double click or enter. Press the button Next, select the I accept, Next, Next. Entering the field with localdomain Network Domain, Server Name field with the localhost, and the Administrator Email Address to webmaster @ localhost. If you are using NT/2000/XP, select Run as roundness Service Apache to run automatically on every computer is turned on. Press Next. Select Complete roundness. Press Next, Next and Install. Instaler akan extract all the files to complete. Press the button Finish.
Step three: On NT/2000/XP, Apache should now run automatically. In Windows 95/98/ME, do the following: select Start Menu> Programs> Apache HTTP Server> Control Apache Server> Start. You will see a text window labeled "Apache/1.3.x (Win32) running ..." Do not close this window, unless you want to ignore Apache. During play with PHP, you will need to continue to Apache. Apache only minimize this window.
Step four: Check the Apache open a browser and type in the address http://localhost. If the text appears with a "Not Acceptable" then the installation was successful.
Configuring apache is in the c: \ Program Files \ Apache Group \ Apache \ conf. You put a script in PHP-scripts c: \ Program Files \ Apache Group \ Apache \ htdocs.
To the number 9 to install MySQL.
Problem:
* If the fourth step shown in another page, there is a possibility that the webserver is also running (for example, IIS). Solution, stop IIS first. In Windows 2000, do: select Start Menu> Programs> Administrative Tools> Services. Log In Stop on the World Wide Web Publishing Service.
7. Apache Webserver on Linux RPM version (2 minutes)
In Unix / Linux, of course, there are many options webserver, both free and commercial. However, because Apache is the most popular, flexible, and relatively safe, then this guide will only discuss the Apache.
Apache always available in almost all Linux distributions. But try to see if apache is installed packages:
Rpm-q apache #
If any posts appear "apache-1.3.xx" then means that Apache is installed. If any posts appear "package apache not installed" then you need to install the Apache RPM. How:
The first step: enter instaler Red Hat CD.
Step two: cd to the directory RedHat/RPMS/i386. This directory may be different in RedHat version you use, but basically we want to find the file apache-1.3.xx-y.i386.rpm, with xx and y is the code version and release. In RedHat 6.2, for example, a given version of Apache 1.3.12. This file and then we install the following way:
# Rpm-Uvh apache-1.3.xx-y.i386.rpm
Step three: Run Apache by typing:
# / Etc / rc.d / init.d / httpd start
Step three: Check the Apache type lynx http://localhost address or URL of the Netscape browser. If it appears in the "Not Acceptable" means that the installation was successful.
You put a script in PHP-scripts / home / httpd / htdocs.
To the number 10 for the installation of MySQL.
8. Apache webserver for Linux version of the source (15-30 minutes)
In Unix / Linux, of course, there are many options webserver, both free and commercial. However, because Apache is the most popular, flexible, and relatively safe, then this guide will only discuss the Apache.
The first step: Click the software> All packages> apache CD from the main menu and download the installer file. Tar.gz to. Or, download the latest tarball from httpd.apache.org Apache.
Step two: Once downloaded and added to a specific directory, extract tarball with this command:
Xfz apache_1.3.22.tar.gz # tar-C / usr / src
Akan extract the files to the directory / usr / src. Next:
Three steps:
# Cd / usr/src/apache_1.3.22
#. / Configure - prefix = / usr / local / apache - enable-shared = max
The process of development the first phase is to run configure script as above. There are many options to choose from, among others, if you want the module in the Apache binary (static) or separately and loaded at run-time (dynamic / DSO), and also if you want to install a proxy module, etc.. For convenience, we will only enter two options: - prefix and - enable-shared. Want to know the meaning of this option? Type. / Configure - help | less.
Step four: After configuration is complete, type:
# Make
This is the process of compilation. This process will take between 3-15 minutes, depending on the speed of the computer. Once completed and returned to the prompt:
Five steps:
# Make install
This process of copying the files to compile the final goal. After a successful install, Apache will be binary in / usr / local / apache / bin / httpd, the Apache configuration in / usr / local / apache / conf / httpd.conf. Scripts PHP-script in / usr / local / apache / htdocs.
Sixth step: Edit the file httpd.conf. At a minimum, change the Group are as follows:
Group nobody
Step Seven: Run Apache by typing:
# / Usr / local / apache / bin / apachectl start
Step Eight: Check Apache type lynx http://localhost address or URL of the Netscape browser. If it appears in the "Not Acceptable" means that the installation was successful.
To the number 11 for the installation of MySQL.
9. MySQL on Windows (5 minutes)
The first step: click the option software> All package> mysql CD from the main menu ago retrieve the file mysql-3.23.42.win.zip. Or download the latest MySQL for Windows from www.mysql.com.
Step two: Open the file. Zip with press and double click. You need WinZip program or readers. ZIP others. Ekstraklah to sementar directory, example: c: \ tmp. In the WinZip, click Extract and content in c: \ tmp To Take in the field.
Step three: open the folder c: \ tmp, double-click setup.exe.
Step four: Press Next, Next, Next, Next. Instaler akan mengkopikan file to c: \ mysql. Press Done.
Kelimat the following steps: Start the MySQL server by doing the following. Select the Start Menu> Run. Type c: \ mysql \ bin \ mysql - console. You will see a text window opens any posts containing "ready for connection." Do not close this window, minimize and let it run.
To the number 12 for the installation of PHP.
10. MySQL in the Linux version of RPM (2-5 minutes)
Red Hat since version 7.0 has been provided in the MySQL distribution package. Make sure you have installed the packages mysql-*. If not, do the same as installing the Apache package. In RedHat 6.x, you can find in the CD package MySQL Power Tools on the site or mysql.com. If not, you can install MySQL from source. See number 11.
11. MySQL in the Linux source code version (20-30 minutes)
The first step: Click the software> All package> mysql from the main menu of the CD and download tarball file. Tar.gz to. Or, download the latest tarball of PHP www.mysql.com.
Step two: Once downloaded and added to a specific directory, extract tarball with this command:
# Tar xfz mysql-3.23.43.tar.gz-C / usr / src
Akan extract the files to the directory / usr / src. Next:
Three steps:
# Cd / usr/src/mysql-3.23.43
#. / Configure-prefix = / usr / local / mysql
The process of development the first phase is to run configure script as above. There are several options which can be selected, but for simplicity, we will enter an option: - prefix. Want to know the meaning of choice and other options? Type. / Configure - help | less.
Step four: After configuration is complete, type:
# Make
This is the process of compilation. This process will take between 10-30 minutes, depending on the speed of your computer. Once completed and returned to the prompt:
Five steps:
# Make install
This process of copying the files to compile the final goal.
Step six: Run / usr / local / mysql / bin / mysql_install_db. This script will set up a database administration. After that, run and give the MySQL root password to the MySQL command:
# / Usr / local / mysql / bin / safe_mysqld &
# / Usr / local / mysql / bin / mySQLadmin-u root password SECRET
Do not forget to sign & in the command line first. Replace with the password SECRET indeed.
MySQL has been installed. To the number 14 for the installation of PHP.
12. Installing PHP on Windows (5-15 minutes)
The first step: click the option software> All package> php CD from the main menu ago capture file php-4.0.6-Win32.zip, or download for Windows PHP from www.php.net.
Step two: double click to open the file. This zip. Note: You must have WinZip or another ZIP program notes first.
Step three: Extract all the files you have. With WinZip you can do the following: press and Extract icons, and enter c: \ php to the Extract To field. Press the Extract.
Step four: Kopikan file php.ini-dist to your Windows directory (c: \ windows or c: \ WinNT). Change the name to php.ini.
Step Five: Open the file php.ini in Notepad. Look for the string and change the extension_dir to:
extension_dir = c: / php / extensions
Note the sign of the directory separator is used here, namely /, not \.
Step six: kopikan file php4ts.dll in the directory c: \ php to the directory c: \ windows \ system (for Windows 9x/Me) or c: \ WinNT \ system32 (for NT/2000/XP). Then open the file c: \ Program Files \ Apache Group \ Apache \ conf \ httpd.conf in Notepad and add the following line at the bottom of the LoadModule lines that already exist:
LoadModule php4_module c: / php/sapi/php4apache.dll
AddType application / x-httpd-php. Php
And add the following line at the bottom-line AddModule lines that already exist:
AddModule mod_php4.c
Save the file and restart Apache. How, select Start Menu> Programs> Apache HTTP Server> Control Apache Server> Restart.
Step seven: Now you have the ability skripting PHP Apache. How do I try? Let's create a small PHP script. Create a file in the following location: c: \ Program Files \ Apache Group \ Apache \ htdocs \ test.php and fill:
Http: / / localhost / test.php, and open the URL in your browser. If any posts appear "2" means that the installation was successful.
Done. For the number 99.
13. RPM version of PHP on Linux (5-10 minutes)
Red Hat since version 7.0 include PHP4. Red Hat 6.2 still includes PHP3. Step the following guidelines are intended to install PHP4 on Red Hat 6.2 or Red Hat 7.x RPM is not installed PHP4. If you are using Red Hat 7.x, try to check with rpm-q php and mod_php rpm-q (as in the time to check the package of Apache). If not, please install from the CD instaler Red Hat.
For Red Hat 6.2, we can use PHP RPM packages prepared by Troels Arvin. How:
The first step: Select the software> All package> rpm-php-Arvin from the main menu of the CD. Or, download the package from rpms.arvin.dk / php /.
Step two: As the first choice, take the file RPM gd, expat, mod_php, php, php-standalone, php-mysql, php-gd_with_gif. For each file in the order in the RPM, do rpm-Uvh file name. Or, do the same with rpm-Uvh *. rpm. Mod_php RPM will automatically add the necessary lines in httpd.conf Apache, so you do not need to edit manually.
Step three: Restart Apache. I: / etc / rc.d / init.d / httpd restart.
Step four: Check the following PHP. Create a file in / home / httpd / htdocs named test.php. Fill in the following:
Save the file and open http://localhost/test.php in the browser. You will see a "2", a sign has been running PHP.
Done. For the number 99.
14. Version of PHP in Linux source code (20-30 minutes)
The first step: Click the software> All package> php CD from the main menu and download the tarball file. Tar.gz to. Or, download the latest tarball of PHP from www.php.net.
Step two: Once downloaded and added to a specific directory, extract tarball with this command:
# Tar-xfz php 4.0.x.tar.gz-C / usr / src
X states with the real version number. Akan extract the files to the directory / usr / src. Next:
Three steps:
# Cd / usr/src/php-4.0.x
#. / Configure - with-apxs = / usr / local / apache / bin / apxs - with-mysql = / usr / local / mysql
The process of development the first phase is to run configure script as above. There are many options to choose from, among others, also if you want to install the PHP module for drawing Flash, PDF processing, etc.. For convenience, we will only enter two options: - with-apxs and - with-mysql. Want to know the meaning of this option? Type. / Configure - help | less.
Step four: After configuration is complete, type:
# Make
This is the process of compilation. This process will take between 15-30 minutes, depending on the speed of your computer. Once completed and returned to the prompt:
Five steps:
# Make install
This process of copying the files to compile the final goal.
Sixth step: Edit the file / usr / local / apache / conf / httpd.conf. Add the following lines:
AddType application / x-httpd-php. Php
Step Seven: Save the file and restart Apache. I: / etc / rc.d / init.d / httpd restart.
Step Eight: Check with PHP to create files in / usr / local / apache / htdocs named test.php. Fill in the following:
Save the file and open http://localhost/test.php in the browser. You will see a "2", a sign has been running PHP.
Done. For the number 99.
99. Now where?
Congratulations, you now have a system that PHP can be used to learn PHP, try the script-script PHP, etc..
If you have difficulty, do not directly despair. For beginners, I recommend that the first step to try the most simple (using PHPTriad in Windows, or RPM package in Linux). Sempatkan read the instructions (which are usually called INSTALL in Unix) or the FAQ in the documentation CD.
Now what? Learn! Please see the PHP manual, or visit sites such as www.phpbuilder.com. Or, join the mailing-list and start requesting PHP. Mail, along with other sites that can also be useful for you, you can see in the box PHP Resource.
Guide System in php
Monday, July 6, 2009
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment