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

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

PHP 4.4.9 for Windows Server 2003 (64bit) on IIS 6.0

PHP 4.4.9 for Windows Server 2003 (64bit) on IIS 6.0
Last update 2009-05-12 by SimonXu

Step 1: install PHP (Reference: http://blog.templatehome.cn/post/214):

1) unzip php-4.4.9-Win32 to E:\php

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

3) Copy a E:\PHP\php.ini-dist to C:\WINDOWS\php.ini and modify
extension_dir = “./” to extension_dir = “D:\php\extensions”

4) Copy “php4ts.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) Copy “php4isapi.dll” to “C:\WINDOWS” and change the security for its Properties:
Add “Everyone”, “IIS_WPG”, “Internet GUest Account(XXXserverName\IUSR_XXXserverName)” with permission “Full Control”

6) Change the Environment PATH for windows by “My computer”->”Properties”->”Advanced”->”Environment Variables”->”System Variables” to modify “PATH”: add “E:\php;E:\php\dlls;E:\php\extensions;E:\php\sapi;” to the front of the PATH (!Important!)

Setp 2: Change IIS 6 from 64bit to 32bit support ASP.NET 2.0 to support ASP/HTML/PHP in a same time(Reference: http://support.microsoft.com/?id=894435)

1) change to 32 bit run this cmd:
cscript %SYSTEMDRIVE%\inetpub\adminscripts\adsutil.vbs SET W3SVC/AppPools/Enable32bitAppOnWin64 1

2) Open “Administrative Tools” -> “Internet Information Services (IIS) Manager”->”Web Sites”->”Properties”->”ISAPI Filters” change the 64bit filter to 32bit version:
Remote: ASP.NET_2.0.50727.0 (path: C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\aspnet_filter.dll)
Add: ASP.NET_2.0.50727.0(32) (path: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_filter.dll)

3) Add a new web service extensions for “ASP.NET_2.0.50727(32)” from “Internet Information Services (IIS) Manager”->”Web Service Extensions”->”Add a new web service extensions”->Extension Name: ASP.NET_2.0.50727(32) -> Require files: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll and enable “Set extension status to Allowed”

4) Restart IIS by cmd:
net stop w3svc
net stop iisadmin /yes
net start iisadmin
net start w3svc

Step 3: Change IIS to support PHP:

1) 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: PHP4 -> Require files: C:\WINDOWS\php4isapi.dll and enable “Set extension status to Allowed”

2) Open “Internet Information Services (IIS) Manager”->”Web Sites”->”Default Web Site”->”Properties”->”ISAPI Filters” and add a PHP filter by name: php, Executable: C:\WINDOWS\php4isapi.dll (after reset IIS, the status should be turn to “Loaded”)

3) Open “Internet Information Services (IIS) Manager”->”Web Sites”->”Default Web Site”->”Properties”->”Home Directory”->”Configuration…” to add a “.php” extension by “Executable: C:\WINDOWS\php4isapi.dll” and let other setting as default.

4) Reset IIS by cmd : iisreset

That’s all, enjoy~

Powered by WordPress | Theme: Motion by 85ideas.