godaddy虚拟主机上传文件有限制,限制为8M。可以通过改php.ini文件。
默认会有一个php.ini文件,但是改来改去不生效,最后把php.ini重命名为php5.ini,《《你的主机如果是godaddy主机,php版本默认是5,需要php5.ini,你自己可以在根目录新建一个。记得要备份啊,另外修改后稍微等2到10分钟,等待服务器生效。》》发现生效了。
只需要添加三行代码:
upload_tmp_dir = /tmp
upload_max_filesize = 100M
post_max_size = 100M
修改前建议备份,如果那里错了,可以恢复。另外好像修改后大概等2-10分钟内生效,我把上传值修改为100M。
另外如果修改错误,我附上一php.ini的备份文件吧!
register_globals = off
allow_url_fopen = off
expose_php = Off
max_input_time = 60
variables_order = "EGPCS"
extension_dir = ./
upload_tmp_dir = /tmp
precision = 12
SMTP = relay-hosting.secureserver.net
url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=,fieldset="
; Only uncomment zend optimizer lines if your application requires Zend Optimizer support
;[Zend]
;zend_optimizer.optimization_level=15
;zend_extension_manager.optimizer=/usr/local/Zend/lib/Optimizer-3.3.3
;zend_extension_manager.optimizer_ts=/usr/local/Zend/lib/Optimizer_TS-3.3.3
;zend_extension=/usr/local/Zend/lib/Optimizer-3.3.3/ZendExtensionManager.so
;zend_extension_ts=/usr/local/Zend/lib/Optimizer_TS-3.3.3/ZendExtensionManager_TS.so
; -- Be very careful to not to disable a function which might be needed!
; -- Uncomment the following lines to increase the security of your PHP site.
;disable_functions = "highlight_file,ini_alter,ini_restore,openlog,passthru,
; phpinfo, exec, system, dl, fsockopen, set_time_limit,
; popen, proc_open, proc_nice,shell_exec,show_source,symlink"