[英]Edit php.ini file using DirectAdmin
I want to edit my php.ini
file to allow file uploads. 我想编辑我的
php.ini
文件以允许文件上传。 Running phpinfo()
tells me that it is located at /usr/local/lib/php.ini
. 运行
phpinfo()
告诉我它位于/usr/local/lib/php.ini
。 However, I am paying for hosting and can only make these changes via DirectAdmin . 但是,我支付托管费用,只能通过DirectAdmin进行这些更改。
How can I make the change I need to make to my PHP config using DirectAdmin? 如何使用DirectAdmin对我的PHP配置进行更改?
Alternatively if the php.ini file is located on a shared host and the administrator is not willing to make changes (which often is the case) you can create a ".user.ini" file with the following settings to allow uploading of files. 或者,如果php.ini文件位于共享主机上且管理员不愿意进行更改(通常是这种情况),则可以使用以下设置创建“.user.ini”文件以允许上载文件。 Just adjust the values to your requirements.
只需根据您的要求调整值。
max_execution_time = value
max_input_time = value
post_max_size = value
upload_max_filesize = value
memory_limit = value
If you are using ubuntu server, php.ini file is found in apache2 dir 如果您使用的是ubuntu服务器,则可以在apache2目录中找到php.ini文件
Open php ini file 打开php ini文件
sudo nano /etc/php5/apache2/php.ini
And change upload_max_filesize
and post_max_size
in order to increase uploaded file size limit. 并更改
upload_max_filesize
和post_max_size
以增加上传的文件大小限制。
Next restart apache server 接下来重启apache服务器
sudo service apache2 restart
or 要么
sudo /etc/init.d/apache2 restart
Now check phpinfo()
现在检查
phpinfo()
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.