Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
#1 2008-08-26 19:22:41
- dreamer
- Member
- Registered: 2007-06-08
- Posts: 242
Which folder to upload php.ini file?
I’m trying to increase the limit of the file size upload. I know I need to install a php.ini file into the folder that will use it. But I’m not sure which folder to ftp it to? I know it’s not the main root. And it doesn’t seem to be the textpattern folder either.
Offline
#2 2008-08-27 00:55:33
- dreamer
- Member
- Registered: 2007-06-08
- Posts: 242
Re: Which folder to upload php.ini file?
Let me put it differently;
Which folder houses the script that allows you to upload files?
Offline
Re: Which folder to upload php.ini file?
Don’t worry about the php.ini location in the file system. Add a line with the file size limit you require similar to php_value upload_max_filesize 120K
in your .htaccess file.
Last edited by joebaich (2008-08-27 01:50:36)
Offline
#4 2008-08-27 02:22:27
- dreamer
- Member
- Registered: 2007-06-08
- Posts: 242
Re: Which folder to upload php.ini file?
The .htaccess option never worked to begin with. I get the following message at the upper left hand side of the file screen;
Failed to upload file – File exceeds the upload_max_filesize directive in php.ini
That leads me to believe it’s the php.ini file.
I’ve tried inputting both of these lines of code into the .htaccess file;
#php_value upload_max_filesize 16M
#php_value memory_limit 16M
and neither works.
I know it’s the php.ini file but just don’t know which folder.
Last edited by dreamer (2008-08-27 02:22:58)
Offline
Re: Which folder to upload php.ini file?
If you had the hash in front of the php_value upload_max_filesize, it wouldn’t work because that’s a comment. If you’re running PHP as cgi or fastcgi (diagnostics – PHP SAPI), then you should use php.ini.
You can place the php.ini file in the web root (e.g., /www). Use the following, substituting any values for 10M and 20M.
upload_max_filesize = 10M ;
post_max_size = 20M ;
Last edited by jm (2008-08-27 03:16:04)
Offline
#6 2008-08-27 03:34:48
- dreamer
- Member
- Registered: 2007-06-08
- Posts: 242
Re: Which folder to upload php.ini file?
I actually took out the hash mark before. But that only shut down my entire site with an internal server error. Below is the actual .htaccess file just in case I’m missing something. Apparently, there is something that I’m missing. And no, I’m not running php fastcgi. My host is Bluehost and I just went into the cpanel and upgraded it to php 5.
#DirectoryIndex index.php index.html
#Options +FollowSymLinks
#Options -Indexes
<IfModule mod_rewrite.c> RewriteEngine On #RewriteBase /relative/web/path/
RewriteCond %{REQUEST_FILENAME} -f [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^(.+) – [PT,L]
RewriteRule ^(.*) index.php
RewriteCond %{HTTP:Authorization} !^$
RewriteRule .* – [E=REMOTE_USER:%{HTTP:Authorization}]
</IfModule>
#php_value memory_limit 16MB
#php_value upload_max_filesize 16M
#php_value register_globals 0
I also have the php.ini file installed into the root and that didn’t work. I had the following;
post_max_size = 8M
upload_max_filesize = 8M
Last edited by dreamer (2008-08-27 03:36:18)
Offline
Re: Which folder to upload php.ini file?
You definitely need the .ini file then. Bluehost says it should work in the public_html directory, but you could try the textpattern/includes directory.
Offline
#8 2008-08-27 04:01:51
- dreamer
- Member
- Registered: 2007-06-08
- Posts: 242
Re: Which folder to upload php.ini file?
Arghhhh…. I’m just at my wits end here. The /includes directory doesn’t work either and I get the same error message about the upload_max_filesize .
I just set the darn thing to 16M for a simple 3M file.
Offline
Re: Which folder to upload php.ini file?
I’d try contacting your host’s support, but in the meantime, you can just FTP the file and import it via Content>Files.
Offline
#10 2008-09-01 22:34:34
- dreamer
- Member
- Registered: 2007-06-08
- Posts: 242
Re: Which folder to upload php.ini file?
Finally fixed. Here’s what you have to do for future reference assuming your host (mine is Bluehost) has cpanel;
- log into cpanel
- find the phpconfig button to edit your php configuration
- Select the php5 (fastcgi) option. I had mine set to php5 instead. Here are the benefits to selecting fastcgi as well as the pitfalls . The primary benefit to selecting php 5 (fastcgi) is that the php.ini file is located in the public_html/ folder and its code will cascade to all subdirectories whereas php 4 and php 5 will need to have a php.ini copied into each individual directory that needs it.
- You can also select to have the file include the settings for IonCube and/or SourceGuardian. Tech support said this was optional but they did it anyway.
- Find these lines of code in the php.ini file and update them to the desired size
post_max_size = 8M
upload_max_filesize = 2M
memory_limit = 32M
- Be sure to also go into your admin>preferences>advanced tab. Change the max file size upload to your new desired limit.
You should now be able to upload a bigger file size.
Hope this minimize any headaches for others that run into this issue.
PS. I am aware that you can FTP and then import via Content>Files but this is for clients who don’t know how to FTP. So that wasn’t really an option (from a client’s perspective)
PPS. Although, they can always FTP through the cpanel and then import via Content>Files tab which is slightly easier but still more work for them.
Last edited by dreamer (2008-09-01 22:49:33)
Offline
Pages: 1