Tuesday, April 28, 2009

Overriding PHP settings in Joomla 1.5

Sometimes I need to override default PHP settings in my Joomla projects. For example, it can help when you are trying to install big Joomla component through 'Upload Package File' option, but 'max_execution_limit' PHP option has small value and component hasn't time to install. Or you need to increase 'memory_limit' option for some purposes. Yes, you can change this settings in PHP config file or change it through .htaccess file, but what are you doing when you haven't access to server? For helping in this case I have created simple plugin which helps to override PHP settings. You can download this plugin here.

PS: If you use 'PHP Settings' plugin, please post a rating and a review at the Joomla! Extensions Directory.

31 comments:

  1. Will try to make a translation, and some enhancement if you agree...

    ReplyDelete
  2. It would be nice. It's open source and any help will be appreciated. Also you can share your ideas for improving plugin that I can implement some of them.

    ReplyDelete
  3. can you tell me how to increase the maximum upload limit by this plugin?

    ReplyDelete
  4. Hi, Amit,

    Add the following line to 'PHP settings for overriding' parameter:

    upload_max_filesize=50M

    It increases the size of an uploaded file to 50M.

    ReplyDelete
  5. Its highly informative. I would be visiting your blog hereafter regularly to gather valuable information.


    php web development company chennai

    ReplyDelete
  6. how to update
    upload_max_filesize to 20M

    ReplyDelete
  7. Add the following line to 'PHP settings for overriding' parameter:

    upload_max_filesize=20M

    ReplyDelete
  8. could this extension be used to change the "safe mode" setting. If yes how?

    ReplyDelete
  9. No, it can't be used for settings "Safe mode" option because this parameter can be set only in php.ini for security reason. BTW, it's bad approach use "Safe mode", you can read about this on PHP documentation page.

    ReplyDelete
  10. hi,
    The exec() function is not available can this be executed, i have installed your plugin but i am not able increase the upload limit of the file size, the file type is video and the plugin i am using to upload videos is hwd video share. can u plz help in making this work

    ReplyDelete
  11. Hi sapbw,

    What value you entered into 'PHP settings for overriding' parameter?

    ReplyDelete
  12. below are the parameters

    pcre.backtrack_limit=-1
    memory_limit=64M
    max_execution_time=300
    upload_max_filesize=200M

    ReplyDelete
  13. Probably your hosting provider forbid to change PHP settings.

    ReplyDelete
  14. yes my hosting provide forbid that so only i am using this extension. If they allow me y will i use the extension
    plz suggest regarding this

    ReplyDelete
  15. My plugin doesn't use magic, it's only use 'ini_set' PHP function for overriding PHP settings. If this function is disabled by your hosting provider, my plugin can't help you.

    ReplyDelete
  16. ok fine, thanks for replying,

    thanks and regards

    ReplyDelete
  17. My site is on Godaddy shared hosting.
    I have installed your extension to override PHP settings.
    I want the modify following settings:
    pcre.backtrack_limit=-1
    memory_limit=256M
    max_execution_time=300
    max_input_time=120
    post_max_size=64M
    file_uploads=On
    upload_max_filesize=64M

    But your plugin only changing Memory_limit and Max_execution_time
    It is not overriding any other settings on my server. I don't understand what is wrong here.
    My server support PHP override and still it is not changing any other setting.
    Plz help.

    ReplyDelete
  18. Hi Mann,

    Probably overriding of other settings is disabled by hosting provider.

    ReplyDelete
  19. My server is using the PHP5.ini for 5 version to override the default server settings. But I guess your extension is looking for php.ini instead of PHP5.ini.
    This may be the reason that your extension is not working in my case.
    By the way now I am using custom PHP5.ini file to override the default server settings.

    Well, thanks for all.

    ReplyDelete
  20. The extension calls 'ini_set' PHP function and probably overriding of some PHP settings through this function is disabled by hosting provider.

    ReplyDelete
  21. there is no changing in joomla setting when i add max file upload size ! what is the wrong ?

    ReplyDelete
  22. Probably PHP is ran in safe mode.

    ReplyDelete
  23. could you help me about which folder i must put this plugin file? or how i can modify php settigs? i m very inexperienced in this cases. :|

    ReplyDelete
  24. Install the plugin as standard Joomla! plugin, open plugin settings page, enter php setttings in "PHP settings for overriding" textarea and enable plugin.

    ReplyDelete
  25. Why once i install when I check in php settings in my joomla site it still shows 2m even though i added code to make it 1000m?

    Please help..

    Thanks

    ReplyDelete
  26. Probably PHP is ran in safe mode or changing of this parameter is disabled by hosting administrators

    ReplyDelete
  27. Looking at my System Info > PHP information - Configuration, for the Directive 'Memory_Limit', the Local Value now shows my increase to 100MB but the Master Value still shows the original 48MB. I'm guessing this means that the php.ini file on the server is set at 48MB - does this mean I can't change the increase up to 100MB or will the Local Value still be able to take effect?

    ReplyDelete
  28. "Master Value" contains a value from php.ini file. "Local Value" contains a value which is used for a page.

    ReplyDelete
  29. Read a review reminding newbies like me to restart apache after using this plugin, but how do i do that? I still have a white page..after a JEVENTS and DT REGISTER upgrade, according to jevents i needed to increase memory limit, used your very simple plugin *it was even for someone like me but still a white screen when navigating to the website.

    ReplyDelete
  30. The plugin doesn't require to restart web server.

    ReplyDelete