質問

I'm working with acquia-drupal 7 (just localhost for now), inside Microsoft WebMatrix. I can't get my php upload limit to increase from the default 2MB. Having googled around I have done the following:

added to every existing htaccess:

php_value upload_max_filesize 10M
php_value post_max_size 10M

created php.ini file in every dir that had an htaccess (no php.ini files existed anywhere) containing the following:

upload_max_filesize = 10M
post_max_size = 10M

Restarted the site (through the Webmatrix GUI)

No apparent change whatsoever after any of this - my site still has the 2MB upload limit.

Thoughts?

役に立ちましたか?

解決

The reason your changes are not taking affect are because you just created a php.ini file anew, rather than finding the one that is being used.

By definition, since you just created it, it won't be the one that exists in your php directory. :-)

But don't worry! There's an easy way to find the correct php.ini file that your site is using:

  • Go to /admin/reports/status on your drupal site. Here you will see information about which version of php and apache you're using, etc.
  • The line for 'PHP' on that page should have both the version of php you're using (something like 5.3.6) and a 'more information' link
  • Click on that link and you should be able to see detailed information about the php installation on your machine.
  • Find the line called 'Configuration File (php.ini) Path' on that screen and navigate to that to update it.

Just like you already knew, make sure you restart your server after any changes. :-)

Let us know if this fixes your problem!

他のヒント

Have you ever ran into a problem where you needed to upload relatively large files and still want to be able to manage these from the Drupal 7 administrative interface? If so, you may run into a situation like the one below:

enter image description here

You will notice the 12 MB text stating that we can only upload files that are 12 MB and under. In this case I needed this number to be a little bigger.

In order to do this you will need to modify your PHP settings in your php.ini file.

Note: You should make sure you know what you are doing and understand the consequences of increasing this number. In my case this is on a site that only users that I trust will be uploading files. If you allow any user to upload files, increasing this number can add an increased load on the server and possible eat up your disk space pretty quickly.

Now that you have been warned, here is how I was able to do this. I first found the php.ini file on my system. I am on an Ubuntu server so I was able to get to edit mine using vim like so:

vim /etc/php5/apache2/php.ini

Change the upload_max_filesize setting

The first step was to find the upload_max_filesize setting from 12MB to 30MB.

Change:

enter image description here

To:

enter image description here

Change the post_max_size setting

You may also need to modify the post_max_size setting. I changed the post_max_size php.ini setting from 20MB to 30MB.

Change:

enter image description here

To:

enter image description here

Restart Apache

You should check phpinfo to make sure your php.ini which you edited is the correct one.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top