Php Evolution Environment

In companionship to railroad train in addition to run PHP Web pages, 3 vital components involve to move installed on your reckoner system.

Web Server - PHP volition operate amongst virtually all Web Server software, including Microsoft's Internet Information Server (IIS) but thence most oftentimes used is freely available Apache Server. Download Apache for costless here: http://httpd.apache.org/download.cgi
In companionship to railroad train in addition to run PHP Web pages PHP Development Environment


Database - PHP volition operate amongst virtually all database software, including Oracle in addition to Sybase but most unremarkably used is freely available MySQL database. Download MySQL for costless here: http://www.mysql.com/downloads/index.html

PHP Parser - In companionship to physical care for PHP script instructions, a parser must move installed to generate HTML output that tin move sent to the Web Browser. This tutorial volition guide yous how to install PHP parser on your computer.

PHP Parser Installation

Before yous proceed, it is of import to brand certain that yous lead hold a proper surroundings setup on your machine to railroad train your spider web programs using PHP.

Type the next address into your browser's address box.
http://127.0.0.1/info.php
If this displays a page showing your PHP installation related information, thence it agency yous lead hold PHP in addition to Webserver installed properly. Otherwise yous lead hold to follow given physical care for to install PHP on your computer.

This department volition guide yous to install in addition to configure PHP over the next 4 platforms:

PHP Installation on Linux or Unix amongst Apache

If yous excogitation to install PHP on Linux or whatever other variant of Unix, thence hither is the listing of prerequisites:
Now hither are the steps to install Apache in addition to PHP5 on your Linux or Unix machine. If your PHP or Apache versions are different, thence delight lead hold help accordingly.
  • If yous haven't already done so, unzip in addition to untar your Apache source distribution. Unless yous lead hold a argue to practise otherwise, /usr/local is the criterion place.
gunzip -c apache_1.3.x.tar.gz
tar -xvf apache_1.3.x.tar


  • Build the apache Server equally follows 

cd apache_1.3.x
./configure --prefix=/usr/local/apache --enable-so
make
make install


  • Unzip in addition to untar your PHP source distribution. Unless yous lead hold a argue to practise otherwise, /usr/local is the criterion place. 

gunzip -c php-5.x.tar.gz
tar -xvf php-5.x.tar
cd php-5.x


  • Configure in addition to Build your PHP, assuming yous are using MySQL database. 

./configure --with-apxs=/usr/sbin/apxs \
--with-mysql=/usr/bin/mysql
make
make install

  • Install the php.ini file. Edit this file to drib dead configuration directives: 

cd ../../php-5.x
cp php.ini-dist /usr/local/lib/php.ini


  • Tell your Apache server where yous desire to serve files from, in addition to what extension(s) yous desire to position PHP files. .php is the standard, but yous tin role .html, .phtml, or whatever yous want.
  • Go to your HTTP configuration files (/usr/local/apache/conf or whatever your path is)
  • Open httpd.conf amongst a text editor.
  • Search for the give-and-take DocumentRoot (which should seem twice), in addition to alter both paths to the directory yous desire to serve files out of (in our case, /home/httpd). We recommend a dwelling directory rather than the default /usr/local/apache/htdocs because it is to a greater extent than secure, but it doesn.t lead hold to move inward a dwelling directory. You volition hold all your PHP files inward this directory.
  • Add at to the lowest degree i PHP extension directive, equally shown inward the offset draw of piece of employment of code that follows. In the mo line, we.ve too added a mo handler to lead hold all HTML files parsed equally PHP

AddType application/x-httpd-php .php
AddType application/x-httpd-php .html

  • Restart your server. Every fourth dimension yous alter your HTTP configuration or php.ini files, yous must halt in addition to start your server again. 

cd ../bin
./apachectl start
  • Set the document root directory permissions to world-executable. The actual PHP files inward the directory involve solely move world-readable (644). If necessary, supersede /home/httpd amongst your document root below: 
chmod 755 /home/httpd/html/php

  • Open a text editor. Type: <?php phpinfo(); ?>. Save this file inward your Web server's document root equally info.php. 
  • Start whatever Web browser in addition to browse the file. You must e'er role an HTTP asking (http://www.testdomain.com/info.php or http://localhost/info.php or http://127.0.0.1/info.php) rather than a filename (/home/httpd/info.php) for the file to move parsed correctly
You should encounter a long tabular array of information close your novel PHP installation message Congratulations!




Next
Previous
Click here for Comments

0 komentar:

Please comment if there are any that need to be asked.