环境:windows10、iis10、php5.531nts版、mysql5.7.1
iis设置:
php5.531nts版添加了opcache和zendloader
测试php正常
运行php源码时提示不正常:
回复讨论(解决方案) 开启 php 的错误显示功能
至少你可以看到什么地方出了问题,而不是 500
程序有错误,打开php的错误显示功能再说。
加入以下代码打开错误提示看看。
ini_set('display_errors','on');error_reporting(e_all);
谢谢各位版主的热心回复,本人菜鸟一枚,再帮忙看下我的php.ini,谢谢!
设置display_errors = off
error_log = 1.log
不知道是否设置正确,找不到日志文件,是否是zendloader的原因呢?
无法上传文件,分段回复代码,请抽空帮忙看下。
[php]
;;;;;;;;;;;;;;;;;;;
; about php.ini ;
;;;;;;;;;;;;;;;;;;;
; php's initialization file, generally called php.ini, is responsible for
; configuring many of the aspects of php's behavior.
; php attempts to find and load this configuration from a number of locations.
; the following is a summary of its search order:
; 1. sapi module specific location.
; 2. the phprc environment variable. (as of php 5.2.0)
; 3. a number of predefined registry keys on windows (as of php 5.2.0)
; 4. current working directory (except cli)
; 5. the web server's directory (for sapi modules), or directory of php
; (otherwise in windows)
; 6. the directory from the --with-config-file-path compile time option, or the
; windows directory (c:\windows or c:\winnt)
; see the php docs for more specific information.
; http://php.net/configuration.file
; the syntax of the file is extremely simple. whitespace and lines
; beginning with a semicolon are silently ignored (as you probably guessed).
; section headers (e.g. [foo]) are also silently ignored, even though
; they might mean something in the future.
; directives following the section heading [path=/www/mysite] only
; apply to php files in the /www/mysite directory. directives
; following the section heading [host=www.example.com] only apply to
; php files served from www.example.com. directives set in these
; special sections cannot be overridden by user-defined ini files or
; at runtime. currently, [path=] and [host=] sections only work under
; cgi/fastcgi.
; http://php.net/ini.sections
; directives are specified using the following syntax:
; directive = value
; directive names are *case sensitive* - foo=bar is different from foo=bar.
; directives are variables used to configure php or php extensions.
; there is no name validation. if php can't find an expected
; directive because it is not set or is mistyped, a default value will be used.
; the value can be a string, a number, a php constant (e.g. e_all or m_pi), one
; of the ini constants (on, off, true, false, yes, no and none) or an expression
; (e.g. e_all & ~e_notice), a quoted string (bar), or a reference to a
; previously set variable or directive (e.g. ${foo})
; expressions in the ini file are limited to bitwise operators and parentheses:
; | bitwise or
; ^ bitwise xor
; & bitwise and
; ~ bitwise not
; ! boolean not
; boolean flags can be turned on using the values 1, on, true or yes.
; they can be turned off using the values 0, off, false or no.
; an empty string can be denoted by simply not writing anything after the equal
; sign, or by using the none keyword:
; foo = ; sets foo to an empty string
; foo = none ; sets foo to an empty string
; foo = none ; sets foo to the string 'none'
; if you use constants in your value, and these constants belong to a
; dynamically loaded extension (either a php extension or a zend extension),
; you may only use these constants *after* the line that loads the extension.
;;;;;;;;;;;;;;;;;;;
; about this file ;
;;;;;;;;;;;;;;;;;;;
; php comes packaged with two ini files. one that is recommended to be used
; in production environments and one that is recommended to be used in
; development environments.
; php.ini-production contains settings which hold security, performance and
; best practices at its core. but please be aware, these settings may break
; compatibility with older or less security conscience applications. we
; recommending using the production ini in production and testing environments.
; php.ini-development is very similar to its production variant, except it's
; much more verbose when it comes to errors. we recommending using the
; development version only in development environments as errors shown to
; application users can inadvertently leak otherwise secure information.
; this is php.ini-development ini file.
;;;;;;;;;;;;;;;;;;;
; quick reference ;
;;;;;;;;;;;;;;;;;;;
; the following are all the settings which are different in either the production
; or development versions of the inis with respect to php's default behavior.
; please see the actual settings later in the document for more details as to why
; we recommend these changes in php's behavior.
; display_errors
; default value: on
; development value: on
; production value: off
; display_startup_errors
; default value: off
; development value: on
; production value: off
; error_reporting
; default value: e_all & ~e_notice & ~e_strict & ~e_deprecated
; development value: e_all
; production value: e_all & ~e_deprecated & ~e_strict
; html_errors
; default value: on
; development value: on
; production value: on
; log_errors
; default value: off
; development value: on
; production value: on
; max_input_time
; default value: -1 (unlimited)
; development value: 60 (60 seconds)
; production value: 60 (60 seconds)
; output_buffering
; default value: off
; development value: 4096
; production value: 4096
; register_argc_argv
; default value: on
; development value: off
; production value: off
; request_order
; default value: none
; development value: gp
; production value: gp
; session.gc_divisor
; default value: 100
; development value: 1000
; production value: 1000
; session.hash_bits_per_character
; default value: 4
; development value: 5
; production value: 5
; short_open_tag
; default value: on
; development value: off
; production value: off
; track_errors
; default value: off
; development value: on
; production value: off
; url_rewriter.tags
; default value: a=href,area=href,frame=src,form=,fieldset=
; development value: a=href,area=href,frame=src,input=src,form=fakeentry
; production value: a=href,area=href,frame=src,input=src,form=fakeentry
; variables_order
; default value: egpcs
; development value: gpcs
; production value: gpcs
;;;;;;;;;;;;;;;;;;;;
; php.ini options ;
;;;;;;;;;;;;;;;;;;;;
; name for user-defined php.ini (.htaccess) files. default is .user.ini
;user_ini.filename = .user.ini
; to disable this feature set this option to empty value
;user_ini.filename =
; ttl for user-defined php.ini files (time-to-live) in seconds. default is 300 seconds (5 minutes)
;user_ini.cache_ttl = 300
;;;;;;;;;;;;;;;;;;;;
; language options ;
;;;;;;;;;;;;;;;;;;;;
; enable the php scripting language engine under apache.
; http://php.net/engine
engine = on
php.ini 中令 display_errors = on 然后重启下服务器。
http://www.cnblogs.com/giseryang/archive/2012/09/10/2679340.html
先打开iis错误详情
iis无详细错误,可能是zend不兼容,已放弃。使用其他源码了,谢谢各位!