歡迎光臨, 訪客. 請先 登入註冊一個帳號.
十一月 23, 2024, 11:01:21 上午
19595 文章 在 3865 主題 由 4579 會員
最新註冊會員: aa123aa1
LifeType 中文開發論壇  |  支援  |  安裝與設定  |  求助~關於在windows上安裝blog的php支援的問題 « 上篇主題 下篇主題 »
頁: [1]
作者 主題: 求助~關於在windows上安裝blog的php支援的問題  (閱讀 15257 次)
lovehint37
新手見習
*
文章: 15


檢視個人資料
« 於: 七月 28, 2006, 10:38:03 下午 »

最近想在Windows XP上面安裝blog系統玩玩,我的設備如下:Windows XP Pro+Apache 2.2+MySQL 4+PHP 5
我遇到的問題是php無法在網頁伺服器正常顯示,而是會直接顯示出php原始碼...
我想問題應該是出在Apache支援php的設定這裡,我搜尋過很多文章,並照上面的方法設定過httpd.conf和php.ini 但試了1整天還是失敗...當我在httpd.conf中加入 LoadModule php5_module c:/php/php5apache2.dll 這一行時就會出現如下錯誤訊息,然後apache啟動失敗 目瞪口呆

The Apache service named  reported the following error:
>>> httpd.exe: Syntax error on line 115 of C:/Program Files/Apache2.2/conf/httpd.conf: Cannot load C:/php/php5apache2.dll into server: \xa7\xe4\xa4\xa3\xa8\xec\xab\xfc\xa9w\xaa\xba\xbc\xd2\xb2\xd5\xa1C     .

拿掉這一行apache就能正常執行,但php網頁還是無法正常顯示~
下面是我的apache設定檔:
ThreadsPerChild 100
MaxRequestsPerChild  0
ServerRoot "C:/Program Files/Apache2.2"
Listen 80
LoadModule actions_module modules/mod_actions.so
LoadModule alias_module modules/mod_alias.so
LoadModule asis_module modules/mod_asis.so
LoadModule auth_basic_module modules/mod_auth_basic.so
#LoadModule auth_digest_module modules/mod_auth_digest.so
#LoadModule authn_anon_module modules/mod_authn_anon.so
#LoadModule authn_dbm_module modules/mod_authn_dbm.so
LoadModule authn_default_module modules/mod_authn_default.so
LoadModule authn_file_module modules/mod_authn_file.so
#LoadModule authz_dbm_module modules/mod_authz_dbm.so
LoadModule authz_default_module modules/mod_authz_default.so
LoadModule authz_groupfile_module modules/mod_authz_groupfile.so
LoadModule authz_host_module modules/mod_authz_host.so
LoadModule authz_user_module modules/mod_authz_user.so
LoadModule autoindex_module modules/mod_autoindex.so
#LoadModule cern_meta_module modules/mod_cern_meta.so
LoadModule cgi_module modules/mod_cgi.so
#LoadModule dav_module modules/mod_dav.so
#LoadModule dav_fs_module modules/mod_dav_fs.so
#LoadModule deflate_module modules/mod_deflate.so
LoadModule dir_module modules/mod_dir.so
LoadModule env_module modules/mod_env.so
#LoadModule expires_module modules/mod_expires.so
#LoadModule file_cache_module modules/mod_file_cache.so
#LoadModule headers_module modules/mod_headers.so
LoadModule imagemap_module modules/mod_imagemap.so
LoadModule include_module modules/mod_include.so
#LoadModule info_module modules/mod_info.so
LoadModule isapi_module modules/mod_isapi.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule mime_module modules/mod_mime.so
#LoadModule mime_magic_module modules/mod_mime_magic.so
#LoadModule proxy_module modules/mod_proxy.so
#LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
#LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
#LoadModule proxy_connect_module modules/mod_proxy_connect.so
#LoadModule proxy_http_module modules/mod_proxy_http.so
#LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
LoadModule negotiation_module modules/mod_negotiation.so
LoadModule rewrite_module modules/mod_rewrite.so
LoadModule setenvif_module modules/mod_setenvif.so
#LoadModule speling_module modules/mod_speling.so
#LoadModule status_module modules/mod_status.so
#LoadModule unique_id_module modules/mod_unique_id.so
LoadModule userdir_module modules/mod_userdir.so
#LoadModule usertrack_module modules/mod_usertrack.so
#LoadModule vhost_alias_module modules/mod_vhost_alias.so
#LoadModule ssl_module modules/mod_ssl.so
LoadModule php5_module c:/php/php5apache2.dll
AddType application/x-httpd-php .php
PHPInDir "c:/php/"

ServerAdmin blog.mitnik@gmail.com
ServerName localhost:80
DocumentRoot "C:/Program Files/Apache2.2/htdocs"

<Directory />
    Options FollowSymLinks
    AllowOverride All
    Order deny,allow
    Deny from all
    Satisfy all
</Directory>

<Directory "C:/Program Files/Apache2.2/htdocs">

    Options FollowSymLinks IncludesNoExec

    AllowOverride FileInfo AuthConfig Limit

    Order deny,allow
    Deny from all
    Allow from localhost

</Directory>
#
<Directory "C:/Program Files/Apache2.2/htdocs/phpMyAdmin">
    Options FollowSymLinks IncludesNoExec
   AllowOverride FileInfo AuthConfig Limit
   Order deny,allow
    Deny from all
   Allow from localhost

</Directory>
#
<Directory "C:/Program Files/Apache2.2/htdocs/acid">
    Options FollowSymLinks IncludesNoExec
   AllowOverride FileInfo AuthConfig Limit
   Order deny,allow
    Deny from all
   Allow from localhost

</Directory>
#
<IfModule dir_module>
    DirectoryIndex index.html index.php
</IfModule>

<FilesMatch "^\.ht">
    Order allow,deny
    Deny from all
</FilesMatch>

ErrorLog logs/error.log

LogLevel warn

<IfModule log_config_module>

    LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
    LogFormat "%h %l %u %t \"%r\" %>s %b" common

    <IfModule logio_module>
      # You need to enable mod_logio.c to use %I and %O
      LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
    </IfModule>

    CustomLog logs/access.log common

</IfModule>

<IfModule alias_module>
    #
    # Redirect: Allows you to tell clients about documents that used to
    # exist in your server's namespace, but do not anymore. The client
    # will make a new request for the document at its new location.
    # Example:
    # Redirect permanent /foo http://localhost/bar

    #
    # Alias: Maps web paths into filesystem paths and is used to
    # access content that does not live under the DocumentRoot.
    # Example:
    # Alias /webpath /full/filesystem/path
    #
    # If you include a trailing / on /webpath then the server will
    # require it to be present in the URL.  You will also likely
    # need to provide a <Directory> section to allow access to
    # the filesystem path.

    #
    # ScriptAlias: This controls which directories contain server scripts.
    # ScriptAliases are essentially the same as Aliases, except that
    # documents in the target directory are treated as applications and
    # run by the server when requested rather than as documents sent to the
    # client.  The same rules about trailing "/" apply to ScriptAlias
    # directives as to Alias.
    #
    ScriptAlias /cgi-bin/ "C:/Program Files/Apache2.2/cgi-bin/"

</IfModule>

#
# "C:/Program Files/Apache2.2/cgi-bin" should be changed to whatever your ScriptAliased
# CGI directory exists, if you have that configured.
#
<Directory "C:/Program Files/Apache2.2/cgi-bin">
    AllowOverride None
    Options None
    Order allow,deny
    Deny from all
</Directory>

#
# Apache parses all CGI scripts for the shebang line by default.
# This comment line, the first line of the script, consists of the symbols
# pound (#) and exclamation (!) followed by the path of the program that
# can execute this specific script.  For a perl script, with perl.exe in
# the C:\Program Files\Perl directory, the shebang line should be:

   #!c:/program files/perl/perl

# Note you _must_not_ indent the actual shebang line, and it must be the
# first line of the file.  Of course, CGI processing must be enabled by
# the appropriate ScriptAlias or Options ExecCGI directives for the files
# or directory in question.
#
# However, Apache on Windows allows either the Unix behavior above, or can
# use the Registry to match files by extention.  The command to execute
# a file of this type is retrieved from the registry by the same method as
# the Windows Explorer would use to handle double-clicking on a file.
# These script actions can be configured from the Windows Explorer View menu,
# 'Folder Options', and reviewing the 'File Types' tab.  Clicking the Edit
# button allows you to modify the Actions, of which Apache 1.3 attempts to
# perform the 'Open' Action, and failing that it will try the shebang line.
# This behavior is subject to change in Apache release 2.0.
#
# Each mechanism has it's own specific security weaknesses, from the means
# to run a program you didn't intend the website owner to invoke, and the
# best method is a matter of great debate.
#
# To enable the this Windows specific behavior (and therefore -disable- the
# equivilant Unix behavior), uncomment the following directive:
#
#ScriptInterpreterSource registry
#
# The directive above can be placed in individual <Directory> blocks or the
# .htaccess file, with either the 'registry' (Windows behavior) or 'script'
# (Unix behavior) option, and will override this server default option.
#

#
# DefaultType: the default MIME type the server will use for a document
# if it cannot otherwise determine one, such as from filename extensions.
# If your server contains mostly text or HTML documents, "text/plain" is
# a good value.  If most of your content is binary, such as applications
# or images, you may want to use "application/octet-stream" instead to
# keep browsers from trying to display binary files as though they are
# text.
#
DefaultType text/plain

<IfModule mime_module>
    #
    # TypesConfig points to the file containing the list of mappings from
    # filename extension to MIME-type.
    #
    TypesConfig conf/mime.types

    #
    # AddType allows you to add to or override the MIME configuration
    # file specified in TypesConfig for specific file types.
    #
    #AddType application/x-gzip .tgz
    #
    # AddEncoding allows you to have certain browsers uncompress
    # information on the fly. Note: Not all browsers support this.
    #
    #AddEncoding x-compress .Z
    #AddEncoding x-gzip .gz .tgz
    #
    # If the AddEncoding directives above are commented-out, then you
    # probably should define those extensions to indicate media types:
    #
    AddType application/x-compress .Z
    AddType application/x-gzip .gz .tgz

    #
    # AddHandler allows you to map certain file extensions to "handlers":
    # actions unrelated to filetype. These can be either built into the server
    # or added with the Action directive (see below)
    #
    # To use CGI scripts outside of ScriptAliased directories:
    # (You will also need to add "ExecCGI" to the "Options" directive.)
    #
    #AddHandler cgi-script .cgi

    # For type maps (negotiated resources):
    #AddHandler type-map var

    #
    # Filters allow you to process content before it is sent to the client.
    #
    # To parse .shtml files for server-side includes (SSI):
    # (You will also need to add "Includes" to the "Options" directive.)
    #
    #AddType text/html .shtml
    #AddOutputFilter INCLUDES .shtml
</IfModule>

EnableMMAP off
EnableSendfile off

<IfModule ssl_module>
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
</IfModule>

<IfModule php5_module>
AddType application/x-httpd-php .php
</IfModule>

我省去了一些不必要的內容

下面是php.ini設定檔:
http://mitnik.mine.nu/php.ini

請高手幫幫忙~~謝謝!
已記錄

歡迎看看我的部落格~
http://mitnik.mine.nu/blog
markwu
系統管理員
超級會員
*****
文章: 3928


Mark Wu


檢視個人資料 個人網站
« 回覆文章 #1 於: 七月 28, 2006, 10:58:01 下午 »

Downgrade 回 Apache 2.0.x 吧!目前在 Windows 下 安裝 php5 好像沒有成功過的。要不然就改成 CGI 的安裝方式試試看!

Mark
已記錄

lovehint37
新手見習
*
文章: 15


檢視個人資料
« 回覆文章 #2 於: 七月 29, 2006, 07:41:08 下午 »

原來如此~我再試試看,謝謝 開懷大笑
已記錄

歡迎看看我的部落格~
http://mitnik.mine.nu/blog
lovehint37
新手見習
*
文章: 15


檢視個人資料
« 回覆文章 #3 於: 七月 31, 2006, 01:33:55 上午 »

謝謝!! 我把apache改成2.0.x就可以執行php了,Blog也可以正常作~但是現在又遇到一個問題,我執行
<?php
phpinfo();
?>
這支php和phpmyadmin都可以正長運作,可是當我執行ACID裡面的"Create ACID AG"這個按鈕都沒反應,而且出現好幾行類似的錯誤訊息,如下:
[Mon Jul 31 02:29:14 2006] [error] [client 127.0.0.1] PHP Warning:  Call-time pass-by-reference has been deprecated - argument passed by value;  If you would like to pass it by reference, modify the declaration of [runtime function name]().  If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file.  However, future versions may not support this any longer.  in C:\\Program Files\\Apache Group\\Apache2\\htdocs\\acid\\acid_state_citems.inc on line 1351, referer: http://localhost/acid/acid_db_setup.php
我在Linux安裝ACID的網址如下: http://mitnik.mine.nu/acid
不管在Windows上還是Linux上面裝ACID,要執行"Create ACID AG"時都會出現這個問題,我想這應該是php的問題吧! 有大大可以幫忙一下嗎? 謝謝!!
已記錄

歡迎看看我的部落格~
http://mitnik.mine.nu/blog
james
LifeType 中文發展團隊
超級會員
*****
文章: 823


哼!!你不說,誰會知道你做過那些修改呢!? (丟滑鼠~~)


檢視個人資料 個人網站
« 回覆文章 #4 於: 七月 31, 2006, 06:41:07 上午 »

謝謝!! 我把apache改成2.0.x就可以執行php了,Blog也可以正常作~但是現在又遇到一個問題,我執行
<?php
phpinfo();
?>
這支php和phpmyadmin都可以正長運作,可是當我執行ACID裡面的"Create ACID AG"這個按鈕都沒反應,而且出現好幾行類似的錯誤訊息,如下:
[Mon Jul 31 02:29:14 2006] [error] [client 127.0.0.1] PHP Warning:  Call-time pass-by-reference has been deprecated - argument passed by value;  If you would like to pass it by reference, modify the declaration of [runtime function name]().  If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file.  However, future versions may not support this any longer.  in C:\\Program Files\\Apache Group\\Apache2\\htdocs\\acid\\acid_state_citems.inc on line 1351, referer: http://localhost/acid/acid_db_setup.php
我在Linux安裝ACID的網址如下: http://mitnik.mine.nu/acid
不管在Windows上還是Linux上面裝ACID,要執行"Create ACID AG"時都會出現這個問題,我想這應該是php的問題吧! 有大大可以幫忙一下嗎? 謝謝!!
請自行至acid的官方網站回報討論。 傷心

James.
已記錄

記得發問前,先使用搜尋功能找找看有沒相關的解答。
如果找不到,請依照如何在LifeType論壇發問來提問喔。
頁: [1]
LifeType 中文開發論壇  |  支援  |  安裝與設定  |  求助~關於在windows上安裝blog的php支援的問題 « 上篇主題 下篇主題 »
    前往: