Jump to content

[SOLVED] Where and how to place the php.ini


ksduded

Recommended Posts

So my host (iweb.ca) does not provide a unified php.ini file for my webspace instead they said that I have to create seperate php.ini files and put them in the directory that requires it. I need to increase the upload file size to 5MB. Thus I created a php.ini file with only this code

 

post_max_size = 5M
upload_max_filesize = 5M

 

and put it in the folder where the uploaded files are stored. I tried it, but it didn't work. Am I missing something here.

 

Thanks in advance for any help

Link to comment
Share on other sites

You put it in the directory where your scripts are run from.

 

Ken

 

there is a _mmServerScripts directory in the subdomain where i will be uploading the.

 

the structure is like this

 

www.subdomain.com

www.subdomain.com/_mmServerScripts

www.subdomain.com/uploads/user_directory

 

the images are uploaded in the user_directory and I placed a php.ini there and also placed it in the _mmServerScripts, but I again got the same error message.

 

You could add a .htaccess file in the directory with the following

 

php_value upload_max_filesize 5M 

 

I tried this as well, but it didn't work.

 

I wanted to add that the folder where the images are uploaded is created dynamically once the user enters his email address. So what I am doing is that after the user folder is created, I log in through the ftp and add the php.ini/.htaccess file there manually and then use the website to upload the images. From my understanding, this should work, but please state otherwise, if there is another way of getting this to work.

 

Thanks

Link to comment
Share on other sites

but I again got the same error message.
If you are getting an error message, post it. That is the only way we can help. For all we know your local php.ini worked but the error is being caused by something else.

 

Sorry I should have cleared that up.

 

that error message is from the upload utility that i am using, swfupload, which i have incorporated in my . So its program specific. In other terms, nothing uploads if the file is larger than 2MB.

Link to comment
Share on other sites

Make sure you can even use a local php.ini to change those settings. Start by putting your php.ini file in the document root folder and create a .php script in that folder that contains the following -

 

<?php
phpinfo();
?>

 

Browse to this script and check what those two settings actually are.

Link to comment
Share on other sites

place this in your .htaccess file (website root):

 

Options +ExecCGI
AddHandler php-cgi .php
Action php-cgi /cgi-bin/php5.cgi

 

then place the php.ini file in the root of the domain in a directory called "cgi-bin" you will also have to place your "php5.cgi" file in that directory as well. You will then be able to edit your file as you wish.

 

Note: You should make your "post_max_size" larger than your "upload_max_filesize"

Link to comment
Share on other sites

thank you for the answers. Actually the problem was from my end. I was uploading the php.ini file in the directory where the images were being uploaded. I copied it to the directory where the html php file is, and it worked out.

 

Thanks for the help.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.