Chinaunix首页 | 论坛 | 博客
  • 博客访问: 3029802
  • 博文数量: 181
  • 博客积分: 9990
  • 博客等级: 中将
  • 技术积分: 1865
  • 用 户 组: 普通用户
  • 注册时间: 2006-05-23 09:43
文章分类

全部博文(181)

文章存档

2011年(40)

2010年(17)

2009年(87)

2008年(37)

我的朋友

分类: 网络与安全

2009-01-06 12:06:57

The .msc installer makes this easy. Run the installer:



Next...



Agree...



If the fields weren't filled-in automatically filled-in you'll have to fill them in yourself.
The option "for All Users..." should be selected



Next...



Click on Change...



I've set my path to C:\Server ... feel free to set it to whatever you like
I might add that the install always creates a folder called "Apache2" so you don't need to add a "apache" folder.
If you do you'll end up with a path like "C:\Server\Apache\Apache2".
NOTE: The problem with the path has been fixed in Apache 2.2.2. Install it in C:\Server\Apache2!


Install...



Wait a bit.



Done!

Ok now we'll check if if you'd done it right. A handy tool should have been installed with the server. It's a feather-like icon on the task bar. Right-click and select "Open Apache Monitor".



If the icon next to "Apache2" is green then apache should be running.
Now visit
(or ).

You should see somethikng like this:



It works!

Ok now we'll change a few settings to move the folder in which the web files are stored - the Document Root. (this part is optional but it makes it make things easier).

  • Find:

    DocumentRoot "C:/Server/Apache2/htdocs"

    and change it to

    DocumentRoot "C:/Server/htdocs"

  • Find:

    and change it to whatever you changed the line above to

You have to make sure thet the folder you specified exists and restart apache. Just open thae Apache Monitor and click on "Restart".

[]

to install the new version.
If you had PHP installed you'll have to copy some files to your Apache directory, as described in the step.

This part of the tutorial assumes you have Apache2 already installed.

After downloading the two zip files extract the first on (the one WITHOUT "pecl" in it's name) to C:\Server\ (You can choose wahtever folder you like but it's a good idea to have it all in one place.



After extracting it and rename the folder to "php".
Now Extract the second .zip file to C:\Server\php\ext\. Just copy everything.



Go back to C:\Server\php and rename the file "php.ini-dist" to "php.ini"
Edit the php.ini:

  • ;extension=php_mbstring.dll
    ;extension=php_bz2.dll
    ;extension=php_curl.dll
    ;extension=php_dba.dll
    ;extension=php_dbase.dll
    ;extension=php_exif.dll
    ;extension=php_fdf.dll
    ;extension=php_filepro.dll
    ;extension=php_gd2.dll
    ;extension=php_gettext.dll
    ;extension=php_ifx.dll
    ;extension=php_imap.dll
    ;extension=php_interbase.dll
    ;extension=php_ldap.dll
    ;extension=php_mcrypt.dll
    ;extension=php_mhash.dll
    ;extension=php_mime_magic.dll
    ;extension=php_ming.dll
    ;extension=php_mssql.dll
    ;extension=php_msql.dll
    ;extension=php_mysql.dll
    ;extension=php_oci8.dll
    ;extension=php_openssl.dll
    ;extension=php_oracle.dll
    ;extension=php_pgsql.dll
    ;extension=php_shmop.dll
    ;extension=php_snmp.dll
    ;extension=php_sockets.dll
    ;extension=php_sqlite.dll
    ;extension=php_sybase_ct.dll
    ;extension=php_tidy.dll
    ;extension=php_xmlrpc.dll
    ;extension=php_xsl.dll

    • - This is something you may find on a PHP5.1 host.
      ;extension=php_apc.dll
      ;extension=php_apd.dll
      ;extension=php_bcompiler.dll
      ;extension=php_big_int.dll ; Not an official extension. Replaced by gmp.
      ;extension=php_bitset.dll
      ;extension=php_blenc.dll
      extension=php_bz2.dll
      extension=php_bz2_filter.dll
      ;extension=php_classkit.dll ; Replaced by runkit
      ;extension=php_cpdf.dll
      ;extension=php_crack.dll
      extension=php_curl.dll
      ;extension=php_cvsclient.dll
      ;extension=php_db.dll
      ;extension=php_dba.dll
      ;extension=php_dbase.dll
      ;extension=php_dbx.dll
      ;extension=php_dio.dll
      ;extension=php_docblock.dll
      extension=php_domxml.dll
      ;extension=php_event.dll
      extension=php_mbstring.dll
      ;extension=php_exif.dll
      ;extension=php_fdf.dll
      ;extension=php_fileinfo.dll
      ;extension=php_filepro.dll
      ;extension=php_filter.dll
      ;extension=php_fribidi.dll
      extension=php_gd2.dll
      extension=php_gettext.dll
      extension=php_gmp.dll
      ;extension=php_gopher.dll
      extension=php_hash.dll
      ;extension=php_http.dll
      ;extension=php_hyperwave.dll
      ;extension=php_ibm_db2.dll
      extension=php_id3.dll
      ;extension=php_ifx.dll
      ;extension=php_iisfunc.dll
      ;extension=php_imagick.dll
      extension=php_imap.dll
      ;extension=php_ingres.dll
      ;extension=php_interbase.dll
      extension=php_java.dll
      extension=php_json.dll
      extension=php_ldap.dll
      ;extension=php_lzf.dll
      ;extension=php_mailparse.dll
      extension=php_mcrypt.dll
      extension=php_mcrypt_filter.dll
      extension=php_memcache.dll
      extension=php_mhash.dll
      extension=php_mime_magic.dll
      extension=php_ming.dll
      ;extension=php_msql.dll
      ;extension=php_mssql.dll
      extension=php_mysql.dll
      extension=php_mysqli.dll
      ;extension=php_netools.dll
      ;extension=php_ntuser.dll
      ;extension=php_oci8.dll
      ;extension=php_oggvorbis.dll
      extension=php_openssl.dll
      ;extension=php_oracle.dll
      ;extension=php_parsekit.dll
      extension=php_pdf.dll
      extension=php_pdo.dll
      extension=php_pdo_firebird.dll
      ;extension=php_pdo_mssql.dll
      extension=php_pdo_mysql.dll
      ;extension=php_pdo_oci.dll
      ;extension=php_pdo_oci8.dll
      ;extension=php_pdo_odbc.dll
      ;extension=php_pdo_pgsql.dll
      extension=php_pdo_sqlite.dll
      ;extension=php_perl.dll
      ;extension=php_pgsql.dll
      ;extension=php_phpdoc.dll
      extension=php_pop3.dll
      ;extension=php_printer.dll
      ;extension=php_pspell.dll
      ;extension=php_radius.dll
      extension=php_runkit.dll
      extension=php_sdo.dll
      extension=php_sdo_das_xml.dll
      ;extension=php_shmop.dll
      extension=php_smtp.dll
      ;extension=php_snmp.dll
      extension=php_soap.dll
      ;extension=php_sockets.dll
      extension=php_sqlite.dll
      ;extension=php_ssh2.dll
      ;extension=php_stats.dll
      ;extension=php_sybase_ct.dll
      ;extension=php_threads.dll
      extension=php_tidy.dll
      extension=php_timezonedb.dll
      ;extension=php_translit.dll
      ;extension=php_win32ps.dll
      ;extension=php_win32scheduler.dll
      ;extension=php_win32service.dll
      ;extension=php_win32std.dll
      ;extension=php_xmlrpc.dll
      extension=php_xsl.dll
      ;extension=php_yaz.dll
      extension=php_zip.dll
      extension=php_zlib_filter.dll
    • - The minimum number of extensions a server should have.
      ;extension=php_apc.dll
      ;extension=php_apd.dll
      ;extension=php_bcompiler.dll
      ;extension=php_big_int.dll ; Not an official extension. Replaced by gmp.
      ;extension=php_bitset.dll
      ;extension=php_blenc.dll
      ;extension=php_bz2.dll
      ;extension=php_bz2_filter.dll
      ;extension=php_classkit.dll ; Replaced by runkit
      ;extension=php_cpdf.dll
      ;extension=php_crack.dll
      extension=php_curl.dll
      ;extension=php_cvsclient.dll
      ;extension=php_db.dll
      ;extension=php_dba.dll
      ;extension=php_dbase.dll
      ;extension=php_dbx.dll
      ;extension=php_dio.dll
      ;extension=php_docblock.dll
      extension=php_domxml.dll
      ;extension=php_event.dll
      extension=php_mbstring.dll
      ;extension=php_exif.dll
      ;extension=php_fdf.dll
      ;extension=php_fileinfo.dll
      ;extension=php_filepro.dll
      ;extension=php_filter.dll
      ;extension=php_fribidi.dll
      extension=php_gd2.dll
      extension=php_gettext.dll
      extension=php_gmp.dll
      ;extension=php_gopher.dll
      extension=php_hash.dll
      ;extension=php_http.dll
      ;extension=php_hyperwave.dll
      ;extension=php_ibm_db2.dll
      ;extension=php_id3.dll
      ;extension=php_ifx.dll
      ;extension=php_iisfunc.dll
      ;extension=php_imagick.dll
      ;extension=php_imap.dll
      ;extension=php_ingres.dll
      ;extension=php_interbase.dll
      ;extension=php_java.dll
      ;extension=php_json.dll
      ;extension=php_ldap.dll
      ;extension=php_lzf.dll
      ;extension=php_mailparse.dll
      ;extension=php_mcrypt.dll
      ;extension=php_mcrypt_filter.dll
      ;extension=php_memcache.dll
      ;extension=php_mhash.dll
      ;extension=php_mime_magic.dll
      ;extension=php_ming.dll
      ;extension=php_msql.dll
      ;extension=php_mssql.dll
      extension=php_mysql.dll
      extension=php_mysqli.dll
      ;extension=php_netools.dll
      ;extension=php_ntuser.dll
      ;extension=php_oci8.dll
      ;extension=php_oggvorbis.dll
      extension=php_openssl.dll
      ;extension=php_oracle.dll
      ;extension=php_parsekit.dll
      ;extension=php_pdf.dll
      extension=php_pdo.dll
      ;extension=php_pdo_firebird.dll
      ;extension=php_pdo_mssql.dll
      extension=php_pdo_mysql.dll
      ;extension=php_pdo_oci.dll
      ;extension=php_pdo_oci8.dll
      ;extension=php_pdo_odbc.dll
      ;extension=php_pdo_pgsql.dll
      ;extension=php_pdo_sqlite.dll
      ;extension=php_perl.dll
      ;extension=php_pgsql.dll
      ;extension=php_phpdoc.dll
      ;extension=php_pop3.dll
      ;extension=php_printer.dll
      ;extension=php_pspell.dll
      ;extension=php_radius.dll
      ;extension=php_runkit.dll
      ;extension=php_sdo.dll
      ;extension=php_sdo_das_xml.dll
      ;extension=php_shmop.dll
      ;extension=php_smtp.dll
      ;extension=php_snmp.dll
      extension=php_soap.dll
      ;extension=php_sockets.dll
      ;extension=php_sqlite.dll
      ;extension=php_ssh2.dll
      ;extension=php_stats.dll
      ;extension=php_sybase_ct.dll
      ;extension=php_threads.dll
      ;extension=php_tidy.dll
      ;extension=php_timezonedb.dll
      ;extension=php_translit.dll
      ;extension=php_win32ps.dll
      ;extension=php_win32scheduler.dll
      ;extension=php_win32service.dll
      ;extension=php_win32std.dll
      ;extension=php_xmlrpc.dll
      ;extension=php_xsl.dll
      ;extension=php_yaz.dll
      ;extension=php_zip.dll
      ;extension=php_zlib_filter.dll
    • - All extensions except those that are useless/harmful when run on a webserver.
      ;extension=php_apc.dll
      ;extension=php_apd.dll
      ;extension=php_bcompiler.dll
      ;extension=php_big_int.dll ; Not an official extension. Replaced by gmp.
      ;extension=php_bitset.dll
      ;extension=php_blenc.dll
      extension=php_bz2.dll
      extension=php_bz2_filter.dll
      ;extension=php_classkit.dll ; Replaced by runkit
      extension=php_cpdf.dll
      extension=php_crack.dll
      extension=php_curl.dll
      ;extension=php_cvsclient.dll
      extension=php_db.dll
      extension=php_dba.dll
      extension=php_dbase.dll
      extension=php_dbx.dll
      extension=php_dio.dll
      extension=php_docblock.dll
      extension=php_domxml.dll
      extension=php_event.dll
      extension=php_mbstring.dll
      extension=php_exif.dll
      extension=php_fdf.dll
      extension=php_fileinfo.dll
      extension=php_filepro.dll
      extension=php_filter.dll
      extension=php_fribidi.dll
      extension=php_gd2.dll
      extension=php_gettext.dll
      extension=php_gmp.dll
      extension=php_gopher.dll
      extension=php_hash.dll
      extension=php_http.dll
      extension=php_hyperwave.dll
      ;extension=php_ibm_db2.dll
      extension=php_id3.dll
      ;extension=php_ifx.dll
      ;extension=php_iisfunc.dll
      ;extension=php_imagick.dll
      extension=php_imap.dll
      ;extension=php_ingres.dll
      extension=php_interbase.dll
      extension=php_java.dll
      extension=php_json.dll
      extension=php_ldap.dll
      extension=php_lzf.dll
      extension=php_mailparse.dll
      extension=php_mcrypt.dll
      extension=php_mcrypt_filter.dll
      extension=php_memcache.dll
      extension=php_mhash.dll
      extension=php_mime_magic.dll
      extension=php_ming.dll
      extension=php_msql.dll
      extension=php_mssql.dll
      extension=php_mysql.dll
      extension=php_mysqli.dll
      ;extension=php_netools.dll
      ;extension=php_ntuser.dll
      ;extension=php_oci8.dll
      extension=php_oggvorbis.dll
      extension=php_openssl.dll
      ;extension=php_oracle.dll
      extension=php_parsekit.dll
      extension=php_pdf.dll
      extension=php_pdo.dll
      extension=php_pdo_firebird.dll
      extension=php_pdo_mssql.dll
      extension=php_pdo_mysql.dll
      ;extension=php_pdo_oci.dll
      ;extension=php_pdo_oci8.dll
      extension=php_pdo_odbc.dll
      extension=php_pdo_pgsql.dll
      extension=php_pdo_sqlite.dll
      ;extension=php_perl.dll
      extension=php_pgsql.dll
      ;extension=php_phpdoc.dll
      extension=php_pop3.dll
      ;extension=php_printer.dll
      ;extension=php_pspell.dll
      extension=php_radius.dll
      extension=php_runkit.dll
      extension=php_sdo.dll
      extension=php_sdo_das_xml.dll
      extension=php_shmop.dll
      extension=php_smtp.dll
      extension=php_snmp.dll
      extension=php_soap.dll
      extension=php_sockets.dll
      extension=php_sqlite.dll
      extension=php_ssh2.dll
      ;extension=php_stats.dll
      ;extension=php_sybase_ct.dll
      ;extension=php_threads.dll
      extension=php_tidy.dll
      extension=php_timezonedb.dll
      ;extension=php_translit.dll
      ;extension=php_win32ps.dll
      ;extension=php_win32scheduler.dll
      ;extension=php_win32service.dll
      ;extension=php_win32std.dll
      extension=php_xmlrpc.dll
      extension=php_xsl.dll
      ;extension=php_yaz.dll
      extension=php_zip.dll
      extension=php_zlib_filter.dll
    • - All extensions
      ;extension=php_apc.dll
      ;extension=php_apd.dll
      extension=php_bcompiler.dll
      ;extension=php_big_int.dll ; Not an official extension. Replaced by gmp.
      ;extension=php_bitset.dll
      ;extension=php_blenc.dll
      extension=php_bz2.dll
      extension=php_bz2_filter.dll
      ;extension=php_classkit.dll ; Replaced by runkit
      extension=php_cpdf.dll
      extension=php_crack.dll
      extension=php_curl.dll
      ;extension=php_cvsclient.dll
      extension=php_db.dll
      extension=php_dba.dll
      extension=php_dbase.dll
      extension=php_dbx.dll
      extension=php_dio.dll
      extension=php_docblock.dll
      extension=php_domxml.dll
      extension=php_event.dll
      extension=php_mbstring.dll
      extension=php_exif.dll
      extension=php_fdf.dll
      extension=php_fileinfo.dll
      extension=php_filepro.dll
      extension=php_filter.dll
      extension=php_fribidi.dll
      extension=php_gd2.dll
      extension=php_gettext.dll
      extension=php_gmp.dll
      extension=php_gopher.dll
      extension=php_hash.dll
      extension=php_http.dll
      extension=php_hyperwave.dll
      ;extension=php_ibm_db2.dll
      extension=php_id3.dll
      ;extension=php_ifx.dll
      ;extension=php_iisfunc.dll
      ;extension=php_imagick.dll
      extension=php_imap.dll
      ;extension=php_ingres.dll
      extension=php_interbase.dll
      extension=php_java.dll
      extension=php_json.dll
      extension=php_ldap.dll
      extension=php_lzf.dll
      extension=php_mailparse.dll
      extension=php_mcrypt.dll
      extension=php_mcrypt_filter.dll
      extension=php_memcache.dll
      extension=php_mhash.dll
      extension=php_mime_magic.dll
      extension=php_ming.dll
      extension=php_msql.dll
      extension=php_mssql.dll
      extension=php_mysql.dll
      extension=php_mysqli.dll
      ;extension=php_netools.dll
      extension=php_ntuser.dll
      ;extension=php_oci8.dll
      extension=php_oggvorbis.dll
      extension=php_openssl.dll
      ;extension=php_oracle.dll
      extension=php_parsekit.dll
      extension=php_pdf.dll
      extension=php_pdo.dll
      extension=php_pdo_firebird.dll
      extension=php_pdo_mssql.dll
      extension=php_pdo_mysql.dll
      ;extension=php_pdo_oci.dll
      ;extension=php_pdo_oci8.dll
      extension=php_pdo_odbc.dll
      extension=php_pdo_pgsql.dll
      extension=php_pdo_sqlite.dll
      ;extension=php_perl.dll
      extension=php_pgsql.dll
      extension=php_phpdoc.dll
      extension=php_pop3.dll
      extension=php_printer.dll
      ;extension=php_pspell.dll
      extension=php_radius.dll
      extension=php_runkit.dll
      extension=php_sdo.dll
      extension=php_sdo_das_xml.dll
      extension=php_shmop.dll
      extension=php_smtp.dll
      extension=php_snmp.dll
      extension=php_soap.dll
      extension=php_sockets.dll
      extension=php_sqlite.dll
      extension=php_ssh2.dll
      ;extension=php_stats.dll
      ;extension=php_sybase_ct.dll
      ;extension=php_threads.dll
      extension=php_tidy.dll
      extension=php_timezonedb.dll
      extension=php_translit.dll
      ;extension=php_win32ps.dll
      extension=php_win32scheduler.dll
      extension=php_win32service.dll
      extension=php_win32std.dll
      extension=php_xmlrpc.dll
      extension=php_xsl.dll
      ;extension=php_yaz.dll
      extension=php_zip.dll
      extension=php_zlib_filter.dll
    Note: All extensions as in all that work without additional downloads.
Now you have to install PHP with Apache.
First you'll have to Stop Apache. To do that open the Apache Monitor and click on Stop.



Now go to C:\Server\Apache2\conf and open httpd.conf



Copy the files shown on the image to C:\Server\Apache2\



it. You'll have to follow the instructions in the readme file that comes with the zipfile. Omit everything after

# Add to your httpd.conf

Do NOT do what is written below that line. You have already done it.

Start Apache by opening the Apache Monitor and clicking start.



If you see messages "Module cannot be found" (you shouldn't) just find the module in php.ini and add a semicolon on the beginning of the line.
If PHP was installed correctly the status bar should show something like this:

Apache/2.0.58 (Win32) PHP/5.1.3

Now visit (or ).
If you see information about your PHP install everything should work.
Done!

[]

Remove the whole PHP folder. The only thing you might want to backup is your php.ini.
Remove the selected files from your Apache directory.



Follow the
up to the point where php.ini is edited. If you've backuped your php.ini you can just copy it to the php folder. You should check the extensions part though as these might have changed.

[]

Just pretty much follow the images. Mind the comments below some images.



Next...



Custom install...



Change...



Let's change the path to C:\Server\MySQL so everything is in one place.

Ok then Next...



Install...





Skip this unless you really need to do that...



Installation complete. Now we need to configure the server.
Make sure you've checked the checkbox.











You can change the path if you need to. But you don't have to.





Probably the most important config screen.
You should check "Enable TCP/IP networking" checkbox but there is some risk involved. You should make sure that nobody will connect to that port except for you.
THe second checkbox is also imprtant. If you plan to write SQL which is not as strict or if you're using PHP software which has poorly written queries (vbulletin has problems) you should uncheck it. But you should leave it checked as you should write your SQL correctly.





Check both.



Here you can set the root user (It's something like the server admin if you didn't know) password. You can set it to whatever you like or uncheck the "Modify Security Settings" checkbox.
This will allow you to connect with "root" as the user and an empty string as the password. It's not secure but if no one else connects to you server (nobody should - it's a developement servers) it'll make life easier.





Done!

Now to test it.

This part assumes you have a Server with PHP installed.

Download phpMyAdmin from
.
Extract the file to your you Document Root\pma (C:\Server\htdocs\pma for example).
Edit "config.default.php" located in the pma folder.

  • Find:

    $cfg['PmaAbsoluteUri'] = '';

    and change it to

    $cfg['PmaAbsoluteUri'] = '';

  • (optional) Find:

    $cfg['Servers'][$i]['extension'] = 'mysql'; // The php MySQL extension to use ('mysql' or 'mysqli')

    and change it to

    $cfg['Servers'][$i]['extension'] = 'mysqli'; // The php MySQL extension to use ('mysql' or 'mysqli')

    The mysqli extension was made to use the new functionality introduced in MySQL 4.1 and up. phpMyAdmin can use it.
  • (important) This is where you have to enter you database username and password
    Find:

    $cfg['Servers'][$i]['auth_type']     = 'config';    // Authentication method (config, http or cookie based)?
    $cfg['Servers'][$i]['user']          = 'root';      // MySQL user
    $cfg['Servers'][$i]['password']      = '';          // MySQL password (only needed
                                                        // with 'config' auth_type)

    The only thing that needs to be changed is the "$cfg['Servers'][$i]['password'] = '';" part. You should set it to the password you choose for the root user account. If you decided to leave the password blank you can skip this step.

    $cfg['Servers'][$i]['auth_type']     = 'config';    // Authentication method (config, http or cookie based)?
    $cfg['Servers'][$i]['user']          = 'root';      // MySQL user
    $cfg['Servers'][$i]['password']      = 'root user password';          // MySQL password (only needed
                                                        // with 'config' auth_type)

That would be it. Now visit and if don't see any error it works.

[]

Zend Optimizer is a program the speeds up execution of PHP code and enables you to use code encoded by Zend Guard. Hosts usually have this installed.
Zend Optimizer's newest version is 3.0
(Windows x86 version) You'll need to register on zend.com if you haven't already.
The installation is very simple. Just run the installer.


Next.



Agree. Next.



Set the path to C:\Server\Zend\Optimizer so that everything will ordered nicely. You can set it to anything you like though. Next.



The installer should detect your Apache2 install automacily. If not select Apache 2.x and click on Next.



If you have followed the whole guide you should have you php.ini in C:\Server\php. If not, then you should set it to the folder in which you keep you php.ini.



This should be detected by the installer. If you have followed the whole guide it should be C:\Server\Apache2.



Again if you have followed the whole guide your document root should be C:\Server\public_html



Install. You will be asked if the install is allowed to stop you server. Agree.



Wait untill your server stops, starts and the install finishes.



Finish. Done!
阅读(831) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~