Windows altında kurulum

Bu bölüm Windows 95/98/ME ve Windows NT/2000/XP kullanıcılarına yöneliktir. PHP Windows 3.1 gibi 16 bit platformlarda çalışmamaktadır. Zaman zaman desteklenen Windows platformları yerine Win32 sözcüğünü kullandık.

PHP'yi Windows altında kurmak için iki ana yöntem mevcut; ya elle ya da InstallShield kullanarak.

Microsoft Visual Studio uygulamasına sahipseniz, PHP'yi kaynak kodundan derleyebilirsiniz.

PHP'yi bir defa sisteminize kurduktan sonra, farklı uzantıları deneyebilirsiniz.

Windows InstallShield

Windows PHP yükleyicisi http://www.php.net/, adresindeki indirme sayfasından edinilebilir. Bu yükleyici PHP'nin CGI sürümünü kuracak ve IIS, PWS ve Xitami sunucuları için kullanıma hazır hale getirecektir. Öte yandan, InstallShield yükleyicisi PHP kurulumunu kolaylaştırmakla birlikte, birçok yönden kısıtlayıcı olabilir, örneğin uzantıların otomatik olarak yüklenmesi desteklenmemektedir.

Kullanmak istediğinizHTTP sunucunuzu sisteminize yükleyin ve çalıştığından emin olun.

Kurulum dosyasını çalıştırın ve size sorulan soruları cevaplayın. İki farklı tipte kurulum desteklenmektedir - standart, bütün ayarlar öntanımlı değerler gözetilerek yapılır, ve ileri düzey, sizin verdiğiniz cevaplar üzerinden yapılır.

Kurulum sihirbazı php.ini için gerekli veriyi toplar ve web sunucusunu PHP'ye hazır hale getirir. NT üzerindeki IIS ve PWS için, script map ayarları ile ilgili liste görüntülenir ve sizden yapmak istediğiniz eklenti hakkında bilgi alınır.

Kurulum bir defa tamamlandıktan sonra, sihirbaz sizden sistemi yeniden başlatmanızı isteyecek, sisteminizi yeniden başlatın ve PHP'yi kullanmaya başlayın.

Uyarý

PHP'nin bu şekilde kurulumunun güvenli olmadığını unutmayın. Eğer güvenli bir PHP kurulumu istiyorsanız, elle kurulum yöntemini izlemeli ve her seçeneği dikkatle gözden geçirmelisiniz. Bu otomatik kurulum size PHP'yi hızlı ve sorunsuz biçimde kullanma imkanı sağlar, ancak bu online sunucularda kullanıma da hazırdır anlamına gelmemelidir.

Elle Kurulum Adımları

Bu kurulum rehberi size PHP'yi Windows web sunucunuzda kurup ayarlayabilmeniz için yardımcı olacaktır. http://www.php.net/. adresinden PHP'nin binary zip sürümünü indirmeniz gereklidir. Bu rehberin orjinal sürümü Bob Silva tarafından hazırlanmıştır ve http://www.umesd.k12.or.us/php/win32install.html adresinde bulunabilir.

Bu rehber aşağıdaki elle kurulum yöntemlerini destekler:

Windows için PHP 4 iki farklı şekilde gelir - bir CGI çalıştırılabiliri (php.exe), ve birkaç SAPI modülü (örneğin: php4isapi.dll). Sonraki şekil PHP 4 için daha yenidir, ve ciddi anlamda performans ve yeni özellik getirisi sağlar.

Uyarý

Öte yandan, SAPI modüllerinin henüz üretim kalitesinde OLMADIĞINI bilmelisiniz. Genelde, ISAPI modülü ile özellikle W2K platformu dışındaki ortamlarda ciddi problemler yaşayabilirsiniz.- Şimdiden ASP gibi diğer birçok modülün de kurtulamadığı bir sürü 500 hatasıyla karşılaşmaya hazırlıklı olun. Uyarmadı demeyin!

Bu çakılmaların nedeni, PHP SAPI modülünün PHP kodunun thread-safe sürümünü kullanmalarıdır. Bu yöntem PHP 4 için yenidir, ve henüz tamamen kararlı denebilmesi için yeterli anlamda test edilememiştir, ve birkaç bilinen hata taşımaktadır. Öte yandan, bazı kişiler SAPI modüllerini kullanarak oldukça iyi sonuçlar elde etmişlerdir, ancak biz bu modülleri üretim aşamasında kullanan siteler olup olmadığınu bilmiyoruz. Kısaca - kararlılık sizin için vazgeçilmezse, SAPI modüllerinin performansı ile CGI çalıştırılabilirinin kararlılığını takas edin.

Eğer SAPI modüllerinden birini kullanmaya karar verir ve Windows 95 kullanırsanız, Microsoft DCOM sayfalarından DCOM güncellemesini indirip kurun. ISAPI modülü için, ISAPI 4.0 ile uyumlu bir web sunucusu gereklidir (IIS 4.0, PWS 4.0 ve IIS 5.0 ile test edilmiştir). IIS 3.0 DESTEKLENMEMEKTEDİR. Eğer gerçek PHP desteği istiyorsanız, IIS 4.0 içeren Windows NT 4.0 Option Pack'i indirip kurmalısınız.

Aşağıdaki adımlar bütün kurulumlar için istisnasız yapılmalıdır.

Kaynaktan kurulum

Başlamadan önce bir soruyu cevaplamakta yarar var: "Windows altında derleme neden bu kadar zor?" . Akla iki neden geliyor:

  1. Windows kaynaklarını özgürce paylaşmaktan hoşlanan yazılımcılara (henüz) yeterince sahip değil. Bunun sonucu olarak, yazılım geliştirme için harcanması gereken maddi kaynak çok daha yukarda kalıyor. Bu nedenle yapılanlar, ihtiyaç duyulan araçların Unixten taşınmasıyla mümkün olabiliyor.

  2. Aşağıdaki bilgilerin çoğu "yap ve sorma" biçimindedir. O nedenle arkanıza yaslanın ve komutları mümkün olabildiğince sadık biçimde uygulamaya başlayın.

Preparations

Before you get started, you have a lot to download...

  • For starters, get the Cygwin toolkit from the closest cygwin mirror site. This will provide you most of the popular GNU utilities used by the build process.

  • Download the rest of the build tools you will need from the PHP site at http://www.php.net/extra/win32build.zip.

  • Get the source code for the DNS name resolver used by PHP at http://www.php.net/extra/bindlib_w32.zip. This is a replacement for the resolv.lib library included in win32build.zip.

  • If you don't already have an unzip utility, you will need one. A free version is available from InfoZip.

Finally, you are going to need the source to PHP 4 itself. You can get the latest development version using anonymous CVS. If you get a snapshot or a source tarball, you not only will have to untar and ungzip it, but you will have to convert the bare linefeeds to crlf's in the *.dsp and *.dsw files before Microsoft Visual C++ will have anything to do with them.

Not: Place the Zend and TSRM directories inside the php4 directory in order for the projects to be found during the build process.

Putting it all together

  • Follow the instructions for installing the unzip utility of your choosing.

  • Execute setup.exe and follow the installation instructions. If you choose to install to a path other than c:\cygnus, let the build process know by setting the Cygwin environment variable. On Windows 95/98 setting an environment variable can be done by placing a line in your autoexec.bat. On Windows NT, go to My Computer => Control Panel => System and select the environment tab.

    Uyarý

    Make a temporary directory for Cygwin to use, otherwise many commands (particularly bison) will fail. On Windows 95/98, mkdir C:\TMP. For Windows NT, mkdir %SystemDrive%\tmp.

  • Make a directory and unzip win32build.zip into it.

  • Launch Microsoft Visual C++, and from the menu select Tools => Options. In the dialog, select the directories tab. Sequentially change the dropdown to Executables, Includes, and Library files, and ensure that cygwin\bin, win32build\include, and win32build\lib are in each list, respectively. (To add an entry, select a blank line at the end of the list and begin typing). Typical entries will look like this:

    • c:\cygnus\bin

    • c:\php-win32build\include

    • c:\php-win32build\lib

    Press OK, and exit out of Visual C++.

  • Make another directory and unzip bindlib_w32.zip into it. Decide whether you want to have debug symbols available (bindlib - Win32 Debug) or not (bindlib - Win32 Release). Build the appropriate configuration:

    • For GUI users, launch VC++, and then select File => Open Workspace and select bindlib. Then select Build=>Set Active Configuration and select the desired configuration. Finally select Build=>Rebuild All.

    • For command line users, make sure that you either have the C++ environment variables registered, or have run vcvars.bat, and then execute one of the following:

      • msdev bindlib.dsp /MAKE "bindlib - Win32 Debug"

      • msdev bindlib.dsp /MAKE "bindlib - Win32 Release"

    • At this point, you should have a usable resolv.lib in either your Debug or Release subdirectories. Copy this file into your win32build\lib directory over the file by the same name found in there.

Compiling

The best way to get started is to build the standalone/CGI version.

  • For GUI users, launch VC++, and then select File => Open Workspace and select php4ts. Then select Build=>Set Active Configuration and select the desired configuration. Finally select Build=>Rebuild All.

  • For command line users, make sure that you either have the C++ environment variables registered, or have run vcvars.bat, and then execute one of the following:

    • msdev php4ts.dsp /MAKE "php4ts - Win32 Debug_TS"

    • msdev php4ts.dsp /MAKE "php4ts - Win32 Release_TS"

    • At this point, you should have a usable php.exe in either your Debug_TS or Release_TS subdirectories.

Repeat the above steps with php4isapi.dsp (which can be found in sapi\isapi) in order to build the code necessary for integrating PHP with Microsoft IIS.

Installation of Windows extensions

After installing PHP and a webserver on Windows, you will probably want to install some extensions for added functionality. The following table describes some of the extensions available. You can choose which extensions you would like to load when PHP starts by uncommenting the: 'extension=php_*.dll' lines in php.ini. You can also load a module dynamically in your script using dl().

The DLLs for PHP extensions are prefixed with 'php_' in PHP 4 (and 'php3_' in PHP 3). This prevents confusion between PHP extensions and their supporting libraries.

Not: In PHP 4.0.6 BCMath, Calendar, COM, FTP, MySQL, ODBC, PCRE, Session, WDDX and XML support is built in. You don't need to load any additional extensions in order to use these functions. See your distributions README.txt or install.txt for a list of built in modules.

Not: Some of these extensions need extra dlls to work. Couple of them can be found in the distribution package, in the 'dlls' folder but some, for example Oracle (php_oci8.dll) require dlls which are not bundled with the distribution package.

Copy the bundled dlls from 'dlls' folder to your Windows PATH, safe places are:

c:\windows\system for Windows 9x/Me
c:\winnt\system32 for Windows NT/2000/XP

If you have them already installed on your system, overwrite them only if something doesn't work correctly (Before overwriting them, it is a good idea to make a backup of them, or move them to another folder - just in case something goes wrong).

Tablo 2-1. PHP Extensions

ExtensionDescriptionNotes
php_bz2.dllbzip2 compression functionsNone
php_calendar.dllCalendar conversion functionsBuilt in since PHP 4.0.3
php_cpdf.dllClibPDF functionsNone
php3_crypt.dllCrypt functionsunknown
php_ctype.dllctype family functionsNone
php_curl.dllCURL, Client URL library functionsRequires: libeay32.dll, ssleay32.dll (bundled)
php_cybercash.dllCybercash payment functionsNone
php_db.dllDBM functionsDeprecated. Use DBA instead (php_dba.dll)
php_dba.dllDBA: DataBase (dbm-style) Abstraction layer functionsNone
php_dbase.dlldBase functionsNone
php3_dbm.dllBerkeley DB2 libraryunknown
php_domxml.dllDOM XML functionsRequires: libxml2.dll (bundled)
php_dotnet.dll.NET functionsNone
php_exif.dllRead EXIF headers from JPEGNone
php_fbsql.dllFrontBase functionsNone
php_fdf.dllFDF: Forms Data Format functions.Requires: fdftk.dll (bundled)
php_filepro.dllfilePro functionsRead-only access
php_ftp.dllFTP functionsBuilt-in since PHP 4.0.3
php_gd.dllGD library image functionsNone
php_gettext.dllGettext functionsRequires: gnu_gettext.dll (bundled)
php_hyperwave.dllHyperWave functionsNone
php_iconv.dllICONV characterset conversionRequires: iconv-1.3.dll (bundled)
php_ifx.dllInformix functionsRequires: Informix libraries
php_iisfunc.dllIIS management functionsNone
php_imap.dllIMAP POP3 and NNTP functionsPHP 3: php3_imap4r1.dll
php_ingres.dllIngres II functionsRequires: Ingres II libraries
php_interbase.dllInterBase functionsRequires: gds32.dll (bundled)
php_java.dllJava extensionRequires: jvm.dll (bundled)
php_ldap.dllLDAP functionsRequires: libsasl.dll (bundled)
php_mhash.dllMhash FunctionsNone
php_ming.dllMing functions for FlashNone
php_msql.dllmSQL functionsRequires: msql.dll (bundled)
php3_msql1.dllmSQL 1 clientunknown
php3_msql2.dllmSQL 2 clientunknown
php_mssql.dllMSSQL functionsRequires: ntwdblib.dll (bundled)
php3_mysql.dllMySQL functionsBuilt-in in PHP 4
php3_nsmail.dllNetscape mail functionsunknown
php3_oci73.dllOracle functionsunknown
php_oci8.dllOracle 8 functionsRequires: Oracle 8 client libraries
php_openssl.dllOpenSSL functionsRequires: libeay32.dll (bundled)
php_oracle.dllOracle functionsRequires: Oracle 7 client libraries
php_pdf.dllPDF functionsNone
php_pgsql.dllPostgreSQL functionsNone
php_printer.dllPrinter functionsNone
php_sablot.dllXSLT functionsRequires: sablot.dll (bundled)
php_snmp.dllSNMP get and walk functionsNT only!
php_sybase_ct.dllSybase functionsRequires: Sybase client libraries
php_yaz.dllYAZ functionsNone
php_zlib.dllZLib compression functionsNone