我的朋友订购了VPS,我们遇到了一些问题。 当应该有一个php错误告诉我有什么问题时,服务器会响应500内部服务器错误。
例如我有这个脚本:
<?php
echo 'hi';
?>
用于测试,它只是用于测试。然后我做了一些错误,所以通常php会抛出一些错误:
<?php
echo 'hi';
sdsd
sd
?>
但在我们的情况下,服务器现在抛出500内部服务器错误,而不是显示一个小警告。我没有更改任何文件权限或任何可能导致此问题的内容,我认为这是配置。
我在这里发布了php.ini:
[Verisign Payflow Pro]
pfpro.defaultport = 443
pfpro.defaulttimeout = 30
pfpro.defaulthost = "test-payflow.verisign.com"
[ODBC]
odbc.allow_persistent = On
odbc.defaultbinmode = 1
odbc.max_links = -1
odbc.check_persistent = On
odbc.defaultlrl = 4096
odbc.max_persistent = -1
[Assertion]
[mSQL]
msql.allow_persistent = On
msql.max_persistent = -1
msql.max_links = -1
[Sybase]
sybase.max_links = -1
sybase.compatability_mode = Off
sybase.min_error_severity = 10
sybase.allow_persistent = On
sybase.min_message_severity = 10
sybase.max_persistent = -1
[gd]
[MySQL]
mysql.default_socket =
mysql.max_links = -1
mysql.default_password =
mysql.default_port =
mysql.allow_persistent = On
mysql.max_persistent = -1
mysql.default_user =
mysql.default_host =
mysql.trace_mode = Off
mysql.connect_timeout = 60
[COM]
[exif]
[Sybase-CT]
sybct.allow_persistent = On
sybct.max_persistent = -1
sybct.min_client_severity = 10
sybct.max_links = -1
sybct.min_server_severity = 10
[Session]
session.bug_compat_42 = 0
session.auto_start = 0
session.cache_limiter = nocache
session.bug_compat_warn = 1
url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=fakeentry"
session.name = PHPSESSID
session.hash_function = 0
session.entropy_length = 0
session.serialize_handler = php
session.cookie_path = /
session.entropy_file =
session.gc_probability = 1
session.cache_expire = 180
session.gc_divisor = 1000
session.cookie_domain =
session.gc_maxlifetime = 1440
session.referer_check =
session.save_handler = files
session.save_path = "/tmp"
session.cookie_lifetime = 0
session.use_cookies = 1
session.use_trans_sid = 0
session.hash_bits_per_character = 5
[mbstring]
[Date]
[soap]
soap.wsdl_cache_ttl = 86400
soap.wsdl_cache_enabled = 1
soap.wsdl_cache_dir = "/tmp"
[mail function]
sendmail_path = /usr/sbin/sendmail -t -i
smtp_port = 25
smtp = localhost
[PostgresSQL]
pgsql.max_links = -1
pgsql.allow_persistent = On
pgsql.log_notice = 0
pgsql.auto_reset_persistent = Off
pgsql.ignore_notice = 0
pgsql.max_persistent = -1
[SQL]
sql.safe_mode = Off
[bcmath]
bcmath.scale = 0
[MySQLi]
mysqli.default_host =
mysqli.default_pw =
mysqli.reconnect = Off
mysqli.default_user =
mysqli.default_socket =
mysqli.max_links = -1
mysqli.default_port = 3306
[Tidy]
tidy.clean_output = Off
[Syslog]
define_syslog_variables = Off
[browscap]
[Informix]
ifx.max_links = -1
ifx.byteasvarchar = 0
ifx.max_persistent = -1
ifx.default_password =
ifx.nullformat = 0
ifx.textasvarchar = 0
ifx.charasvarchar = 0
ifx.allow_persistent = On
ifx.blobinfile = 0
ifx.default_host =
ifx.default_user =
[FrontBase]
[PHP]
asp_tags = Off
include_path = ".:"
ignore_repeated_source = Off
variables_order = "EGPCS"
track_errors = Off
output_buffering = 4096
auto_globals_jit = On
doc_root =
log_errors = On
safe_mode_allowed_env_vars = PHP_
safe_mode_protected_env_vars = LD_LIBRARY_PATH
auto_append_file =
disable_classes =
enable_dl = On
display_startup_errors = Off
user_dir =
extension_dir = "/usr/lib64/php/modules"
register_argc_argv = Off
display_errors = On
open_basedir = "/var/www/vhosts/whatdate.info/httpdocs/:/tmp/"
allow_call_time_pass_reference = Off
safe_mode_exec_dir =
default_socket_timeout = 60
register_globals = Off
unserialize_callback_func =
y2k_compliance = On
magic_quotes_runtime = Off
expose_php = Off
log_errors_max_len = 1024
post_max_size = "16M"
report_memleaks = On
engine = On
memory_limit = "64M"
short_open_tag = On
max_execution_time = 60
safe_mode_include_dir =
serialize_precision = 100
precision = 14
upload_max_filesize = "16M"
register_long_arrays = Off
safe_mode = "off"
zend.ze1_compatibility_mode = Off
zlib.output_compression = Off
ignore_repeated_errors = Off
default_mimetype = "text/html"
disable_functions =
file_uploads = On
magic_quotes_sybase = Off
max_input_time = 60
magic_quotes_gpc = Off
error_reporting = E_ALL
safe_mode_gid = Off
auto_prepend_file =
implicit_flush = Off
allow_url_fopen = On
[MSSQL]
mssql.compatability_mode = Off
mssql.allow_persistent = On
mssql.max_persistent = -1
mssql.min_error_severity = 10
mssql.min_message_severity = 10
mssql.max_links = -1
mssql.secure_connection = Off
任何人都可以告诉我什么是错的或者至少给出一个提示吗?
非常感谢
答案 0 :(得分:1)
您应该检查error.log
另外,维基引用
500 - 一般错误消息,在没有更合适的消息时给出
根据我的经验,我也遇到了拥有777权限的php文件的问题。尝试检查你的php文件的权限。如果发现777,则将其变为755。
一旦php文件获得777权限,它就会被停止并抛出错误500.