PHP Basic(一)eclipse envirement
PHP Basic(一)eclipse envirementnote of web site
http://www.php.net/manual/en/
1. software
phpdownload lastest version of php http://cn2.php.net/distributions/php-5.3.3.tar.gz (source code)
http://windows.php.net/downloads/releases/php-5.3.3-nts-Win32-VC6-x86.zip (package)
http://windows.php.net/downloads/releases/php-5.2.14-nts-Win32-VC6-x86.zip (package)
http://windows.php.net/downloads/releases/php-5.3.3-Win32-VC6-x86.zip (package)
http://windows.php.net/downloads/releases/php-5.2.14-Win32-VC6-x86.zip (package)
notes:
Which version do I choose?
If you are using PHP with Apache 1 or Apache2 from apache.org you need to use the VC6 versions of PHP
If you are using PHP with IIS you should use the VC9 versions of PHP
apache download a stable version of apache http://labs.renren.com/apache-mirror//httpd/binaries/win32/httpd-2.2.16-win32-x86-openssl-0.9.8o.msi
2. install
install apache server
unzip the file php-5.3.3.tar.gz
3. configuration
C:\php-5.3.3
make a copy of php.ini-development, rename it to php.ini
add a line
extension_dir="C:/php-5.3.3/ext"
uncomment
extension=php_mysql.dlland extension=php_gd2.dll
C:\Program Files\Apache Software Foundation\Apache2.2\conf
add these lines to the end of the file httpd.conf
LoadModule php5_module "C:/php-5.3.3/php5apache.dll"
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
Action application/x-httpd-php "C:/php-5.3.3/php-cgi.exe"
AddType application/x-httpd-php .html
AddType application/x-httpd-php .htm
AddDefaultCharset UTF8
PHPIniDir "C:/php-5.3.3"
change system configration
path=c:\php-5.3.3;c:\php-5.3.3\ext
4.test php envirement
new a file named index.php in Apache_home/htdocs with content:
<?php
phpinfo();
?>
restart the apache server, but start fail.The reason is that I use the wrong version of php package. This version is ok on win7 system:
http://windows.php.net/downloads/releases/php-5.3.3-Win32-VC6-x86.zip
It will be ok when I visit URL http://localhost/index.php.
5. Make them work with Eclipse
add the eclipse-php workspace to apache/http.conf:
Alias /php/ "E:/eclipse-php/workspace"
<Directory "E:/eclipse-php/workspace">
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
when I visit the page http://localhost/php/easyphp/test.php, I get the result:
You don't have permission to access
I changed the configuration of http.conf
<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
</Directory>
to
<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
allow from all
</Directory>
eclipse settings
----->------->
choose the proper settings>
PHP Servers----->Default PHP Web Server http://localhost/php
and others
after all the settings, select one index.php file, and run as----> run configuration-----> Run
页:
[1]