星期一, 10月 18, 2010

[PHP] AppServ 設定 curl extension

安裝appserv-win32-2.5.9 的curl啟動異常,重裝2.5.10就正常Orz..


 php-dll關係相依列表:
php_bz2.dll bzip2 compression functions None
php_calendar.dll Calendar conversion functions Built in since PHP 4.0.3
php_cpdf.dll ClibPDF functions None
php_crack.dll Crack functions None
php3_crypt.dll Crypt functions unknown
php_ctype.dll ctype family functions None
php_curl.dll CURL, Client URL library functions Requires: libeay32.dll, ssleay32.dll (bundled)
php_cybercash.dll Cybercash payment functions None
php_db.dll DBM functions Deprecated. Use DBA instead (php_dba.dll)
php_dba.dll DBA: DataBase (dbm-style) Abstraction layer functions None
php_dbase.dll dBase functions None
php3_dbm.dll Berkeley DB2 library unknown
php_domxml.dll DOM XML functions Requires: libxml2.dll (bundled)
php_dotnet.dll .NET functions None
php_exif.dll Read EXIF headers from JPEG None
php_fbsql.dll FrontBase functions None
php_fdf.dll FDF: Forms Data Format functions. Requires: fdftk.dll (bundled)
php_filepro.dll filePro functions Read-only access
php_ftp.dll FTP functions Built-in since PHP 4.0.3
php_gd.dll GD library image functions None
php_gettext.dll Gettext functions Requires: gnu_gettext.dll (bundled)
php_hyperwave.dll HyperWave functions None
php_iconv.dll ICONV characterset conversion Requires: iconv-1.3.dll (bundled)
php_ifx.dll Informix functions Requires: Informix libraries
php_iisfunc.dll IIS management functions None
php_imap.dll IMAP POP3 and NNTP functions PHP 3: php3_imap4r1.dll
php_ingres.dll Ingres II functions Requires: Ingres II libraries
php_interbase.dll InterBase functions Requires: gds32.dll (bundled)
php_java.dll Java extension Requires: jvm.dll (bundled)
php_ldap.dll LDAP functions Requires: libsasl.dll (bundled)
php_mhash.dll Mhash Functions None
php_ming.dll Ming functions for Flash None
php_msql.dll mSQL functions Requires: msql.dll (bundled)
php3_msql1.dll mSQL 1 client unknown
php3_msql2.dll mSQL 2 client unknown
php_mssql.dll MSSQL functions Requires: ntwdblib.dll (bundled)
php3_mysql.dll MySQL functions Built-in in PHP 4
php3_nsmail.dll Netscape mail functions unknown
php3_oci73.dll Oracle functions unknown
php_oci8.dll Oracle 8 functions Requires: Oracle 8 client libraries
php_openssl.dll OpenSSL functions Requires: libeay32.dll (bundled)
php_oracle.dll Oracle functions Requires: Oracle 7 client libraries
php_pdf.dll PDF functions None
php_pgsql.dll PostgreSQL functions None
php_printer.dll Printer functions None
php_xslt.dll XSLT functions Requires: sablot.dll (bundled)
php_snmp.dll SNMP get and walk functions NT only!
php_sybase_ct.dll Sybase functions Requires: Sybase client libraries
php_yaz.dll YAZ functions None
php_zlib.dll ZLib compression functions None



其他AppServ注意事項:
1.若擔心安全性問題,可以把c:\appserv\www\資料夾內的index.php改成自己知道的檔名如myadmin.php,這樣別人就無法知道連結了。

2.Appserv的Apache內定是可以瀏覽目錄,這樣有心人士還是可以看到程式,建議更改Apache的設定檔,用記事本或是Notepad++(下載Notepad++ 5.20)開啟C:\AppServ\Apache2.2\conf\httpd.conf,找到這一段下的
Options Indexes FollowSymLinks MultiViews ExecCGI
把它改成
Options -Indexes FollowSymLinks MultiViews ExecCGI
後重新啟動apache(重新開機)


3.PHP內定上傳檔案是2MB若要加大也需修改檔案,建議用記事本或是Notpad++修改php.ini檔案(位置在C:\WINDOWS\php.ini),找到(約在309行)
display_errors =
把它改成
display_errors = Off
找到(約在399行)
register_globals =
把它改成
register_globals = Off
找到(約在524行)
upload_max_filesize =
把它改成你想上傳檔案的最大值
upload_max_filesize = 200M
找到(約在541行)
default_socket_timeout =
把它改成600秒(內定60秒若是沒在一分鐘內上傳檔案,系統會中斷連線,故把它改成十分鐘,這個值不建議調太太,在多人上線時,這個值太大會影響系統效能)
default_socket_timeout =600
找到(約在641行)
SMTP = localhost
把localhost改成
可以信任發信的主機名字(在學校通常是學校的mail server),因為windows xp及Appserv都沒有發信功能。
調整好後,存檔後重新啟動apache(重新開機)

4.備份資料:若想備份資料庫和檔案,只要把C:\Appserv整個目錄拷貝起來即可,C:\Appserv\www是網站檔案,C:\AppServ\mysql是資料庫內容。

Reference:
How to enable curl in Appserv to overcome Fatal error: Call to undefined function curl_init()
在 AppServ 中啟用 cURL 模組的方法
Vista安裝appsrv,php不能使用mssql、Curl
AppServ 2.5.10 教學

沒有留言:

張貼留言

留個話吧:)