Tag Archive: PHP


1) Run php-5.2.9-2-win32-installer.msi to install php to C:\PHP by auto

2) change the security for “c:\php” Properties:
Add “Everyone”, “IIS_WPG”, “Internet GUest Account(XXXserverName\IUSR_XXXserverName)” with permission “Full Control”

3) Unzip the “php-5.2.9-2-Win32.zip” and copy a php.ini-dist to C:\WINDOWS\php.ini and C:\PHP\php.ini, modify extension_dir = “C:\PHP\ext”; and then Add “Everyone”, “IIS_WPG”,

“Internet GUest Account(XXXserverName\IUSR_XXXserverName)” with permission “Full Control”

4) Copy “php5ts.dll” to “C:\WINDOWS\system32″ and change the security for its Properties:
Add “Everyone”, “IIS_WPG”, “Internet GUest Account(XXXserverName\IUSR_XXXserverName)” with permission “Full Control”

5) Change the Environment PATH for windows by “My computer”>”Properties”>”Advanced”>”Environment Variables”>”System Variables” to modify “PATH” add

“C:\PHP;C:\PHP\ext;”to the front of the PATH (!Important!)

6) Add a new web service extensions for PHP from “Internet Information Services (IIS) Manager”->”Web Service Extensions”->”Add a new web service

extensions”->Extension Name: PHP5 -> Require files: C:\php\php5isapi.dll and enable “Set extension status to Allowed”

7) Open “Internet Information Services (IIS) Manager”->”Web Sites”->”Default Web Site”->”Properties”->”ISAPI Filters” and add a PHP filter by name: php,

Executable: C:\php\php5isapi.dll (after reset IIS, the status should be turn to “Loaded”)

8) Open “Internet Information Services (IIS) Manager”->”Web Sites”->”Default Web Site”->”Properties”->”Home Directory”->”Configuration…” to add a “.php”

extension by “Executable: C:\php\php5isapi.dll” and let other setting as default.

9) Restart IIS by iisreset

That’s all!

此秘笈均为本人的经验总结,已经在多台Red Hat Enterprise Linux 4上实战成功,特和大家一起分享:

1)确认Red Hat Enterprise Linux 4内各旧软件包的版本
以“rpm -q 软件包名” 得到如下:
httpd-2.0.52-28.ent
mysql-4.1.7-4.RHEL4.1
php-4.3.9-3.1
package libxml is not installed
gd-2.0.28-4
gd-2.0.28-4.4E.1
perl-5.8.5-12

2)下载以下软件包(下不到的人可以找我要):
MySQL-server-standard-5.0.24-0.rhel4.x86_64.rpm
MySQL-client-standard-5.0.24-0.rhel4.x86_64.rpm
MySQL-devel-standard-5.0.24-0.rhel4.x86_64.rpm
MySQL-shared-standard-5.0.24-0.rhel4.x86_64.rpm
libxml2-2.6.23.tar.gz
httpd-2.0.59.tar.gz
gd-2.0.33.tar.gz
php-5.1.4.tar.gz
并放到服务器/tmp下面

3)开始安装,基本按下面指令逐行输入即可:
cd /tmp
rpm -e mysql-4.1.7-4.RHEL4.1.i386 –nodeps
rpm -e mysql-server
rpm -e mysql-devel
rpm -Uvh MySQL-server-standard-5.0.24-0.rhel4.x86_64.rpm –nodeps
rpm -ivh MySQL-client-standard-5.0.24-0.rhel4.x86_64.rpm
rpm -ivh MySQL-devel-standard-5.0.24-0.rhel4.x86_64.rpm
rpm -ivh MySQL-shared-standard-5.0.24-0.rhel4.x86_64.rpm
vi /etc/my.conf
关闭#basedir=/var/lib
mkdir /var/run/mysqld
chown mysql.mysql /var/run/mysqld
/sbin/service mysql start

tar -zxvf libxml2-2.6.23.tar.gz
cd libxml2-2.6.23
./configure
make
make tests
make install

tar -zxvf httpd-2.0.59.tar.gz
cd httpd-2.0.59
./configure
make
make install
vi /usr/local/apache2/conf/httpd.conf
增加:
AddType application/x-httpd-php .php
DocumentRoot “/usr/local/apache2/htdocs”
DirectoryIndex index.html index.html.var index.php

vi /etc/rc.d/rc.local
增加:
/usr/local/apache2/bin/apachectl start
(因为旧的Apache在安装Mysql 5后会无法使用)

PHP需要重新编译:
tar -zxvf gd-2.0.33.tar.gz
cd gd-2.0.33
./configure
make install

cd /usr/lib64
cp -p libpng12.a ../lib
cp -p libpng.a ../lib
cp -p libpng.so ../lib

tar -zxvf php-5.1.4.tar.gz
cd php-5.1.4
./configure –prefix=/usr/local/php5 –with-apxs2=/usr/local/apache2/bin/apxs –with-config-filepath=/usr/local/php5 –disable-debug –enable-ftp –enable-inline-optimization –enable-magic-quotes –enable-mbstring –enable-mm=shared –enable-safe-mode –enable-track-vars –enable-trans-sid –enable-wddx=shared –enable-xml –with-dom –with-gd –with-gettext –with-mysql=/usr/lib64/mysql –with-regex=system –with-xml –with-zlib –with-mysqli=/usr/bin/mysql_config
make
make install

cp php.ini-dist /usr/local/php5/lib/php.ini

vi /usr/local/php5/lib/php.ini
include_path = “.:/usr/local/php5/lib/php”

/etc/init.d/mysql restart
/usr/local/apache2/bin/apachectl restart

好了,到此就完成所有工作了。

Powered by WordPress. Theme: Motion by 85ideas.