Installation of PHP Platform On CentOS4.3
Installation of PHP Platform on Linux CentOS4.3
PHP is a scripting language originally designed for producing dynamic web pages. It has evolved to include a command line interface capability and can be used in standalone graphical applications.While PHP was originally created by Rasmus Lerdorf in 1995, the main implementation of PHP is now produced by The PHP Group and serves as the de facto standard for PHP as there is no formal specification.[3] PHP is free software released under the PHP License, however it is incompatible with the GNU General Public License (GPL), due to restrictions on the usage of the term PHP.PHP is a widely-used general-purpose scripting language that is especially suited for web development and can be embedded into HTML. It generally runs on a web server, taking PHP code as its input and creating web pages as output. It can be deployed on most web servers and on almost every operating system and platform free of charge. PHP is installed on more than 20 million websites and 1 million web servers.
How to install PHP platform on CentOS4.3?
-download php
download php-5.2.3.tar.gz to /usr/local/src
cd /usr/local/src
tar xzvf php-5.2.3.tar.gz
-install php
./configure --prefix=/usr/local/php \
--with-mysqli=/usr/local/mysql/bin/mysql_config \
--with-mysql=/usr/local/mysql \
--with-apxs2=/usr/local/apache2/bin/apxs \
--with-curl \
--with-openssl \
--with-gd \ #gd library
--with-jpeg-dir=/usr/lib \
--with-zlib-dir=/usr/local/lib \
--with-png-dir=/usr/local/lib \
--enable-mbstring \
--enable-mbstr-enc-trans \
--enable-versioning \
--enable-imap #when we use imap
make
make test #don't care for some wornings
make install
# php will be installed at /usr/local/php
in /usr/local/apache2/conf/httpd.conf
# LoadModule php4_module modules/libphp4.so
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
cp /usr/local/src/php-5.2.3/php.ini-dist /usr/local/php/lib/php.ini
in /usr/local/php/lib/php.ini
mbstring.http_output = EUC-JP
-php.ini
user_dir = public_html
register_globals = Off #On is dangerous
register_argc_argv = On
magic_quotes_gpc = Off #squirrelmail recommendes Off
magic_quotes_runtime = Off
magic_quotes_sybase = Off
file_uploads = On
-test php
make
<?php phpinfo(); ?>
somewhere and access it.
-test php mysql
<html>
<body>
<?php
$mysqli = new mysqli("tkksqlphp.configureinstallsetup.com", "bob", "e=2.71828", "bob"); #or "localhost"
if (mysqli_connect_errno()) {
printf("Connect failed: %s\n", mysqli_connect_error());
exit();
}else{
printf("Host information: %s<br />\n", $mysqli->host_info);
$mysqli->close();
}
?>
</body>
</html>
- 144 reads
Recent popular content



















