Update Post Max Size in Windows Server - php

I have installed a plug in that the minimum requirement is 32M for post max size.
So I searched this in the web but I can't find the suggested files to be modified.
Increasing the maximum post size
I can't find php.ini and .htaccess in the whole Wordpress folder.
Only Max upload size is configurable in wp-admin/network/settings.php
using get_option( 'blog_upload_space' );
How can I do this ?
I have looked at inetpub folder and can't find it there too.
inetpub:
AdminScripts
custerr
ftproot
history
logs
mailroot
temp
wwwroot

php.ini is not located in wordpress folder, its located in root directory of your server.
in XAMPP.
for, .htaccess its most of the times hidden, so search for hidden files, and if its not present you can create one. but beware, usually updating .htaccess files is not a good idea.

Related

Error in wordpress export

I am using WordPress 3.5.2 version. When i try to export xml file it show me this type error.
What i have to do.
File not found
Firefox can't find the file at http://example.com/wp-admin/export.php?download=true&content=posts&cat=0&post_author=0&post_start_date=0&post_end_date=0&post_status=0&page_author=0&page_start_date=0&page_end_date=0&page_status=0&submit=Download+Export+File.
Check the file name for capitalization or other typing errors.
Check to see if the file was moved, renamed or deleted.
Here 's an update. Ran into the same exact problem, and..
It 's positive, it 's a memory issue. Just like what jjava00 said above, increase the memory_limit.
File to edit : php.ini
Line to edit : 232
string : memory_limit = 32MB.
If you can't find it on line 232, search for this string memory_limit, you 'll get there for sure.
Not sure if each hosting has the same default setup, but my default is 32MB. I increased it to 64MB.
Not all of us have this privilege to edit this php.ini file. Including me. I 'm on a shared hosting. So here 're what I did:
I edit the php.ini of my local apache - set the memory_limit to 64MB. (I use appserv)
Upload it to the root of my web dir (www or public_html or htdocs or whatever).
.. and That 's it.
The export.php script can then create the xml file we need to download - as now there 're enough memory resources to do so, and it can be downloaded. Problem solved.
Source: WordPress Forum
Let me know if there have also problem.

Joomla 3.2 Increase the upload_max_filesiz

I am trying to download this template on Joomla 3.2 extension manger :
http://scriptmafia.org/templates/115622-yt-moustache-yootheme-for-joomla-25-32.html
but every time I upload it, it gives me this error:
There was an error uploading this file to the server.
I have read articles about "increase the upload max size in the php.ini file".
I have tried to find this file in the administrator files section in Joomla, but it is "not found".
So how can I fix this problem? It has not happened for this template only, it has happened for several. So I am almost sure it is due to the upload size.
Edit your php.ini and increase *upload_max_filesize* and *post_max_size*; then restart your web server.
If you don't know where is your php.ini, create a php file to discover: echo php_ini_loaded_file();
The returned path is where your php.ini is located.
EDIT
Well, seems like you have a permission error and not size limit. Try to change permissions of the temp Joomla folder (you can see/configure it on Global Configuration > System).
If you are using XAMPP , php.ini file will be located in c:\XAMPP\php folder. Find the file and increase file upload size there.
If you are using WAMP, You can find ini file in /wamp/bin/php directory.
The location may vary from one OS to another.
You can follow this link:
http://www.cyberciti.biz/faq/linux-unix-apache-increase-php-upload-limit/
You can call in your script ini_set function and change values, which have been stored in php.ini (any changes has affected only for current script, but not for global settings)
ini_set('post_max_size', "%value in MiB for example 16M%")
ini_set('upload_max_filesize', "%value in MiB for example 16M%")
You can read more about it at php.net
If you can't resolve the PHP limitation easily, an alternative is to FTP the installation file to the /tmp folder and in Extension Manager -> Install, use the "Install from Directory" option instead.
Had the same issue for the longest time, none of the answers helped. Found that if you are using GoDaddy, and go to your CPanel, scroll down to Software, then choose PHP version, switch to PHP Options, there you can change your upload file size. Hope this helps, took me forever to find it.
Some people might be having a issue with the memory allocation portion of php.ini file "memory_limit" the default for me was 128mb and i was attempting to upload nearly 300mb and it hit that roadblock. After changing the default value to 512mb and restarting the server i was able to get past this limit.
How to change post_max_size and upload_max_filesize in a local installation of Joomla 3 in XAMPP
You can check the php setting in two places – site’s backend under system information – go to php information. Or on browser go to localhost and click on phpinfo. You’ll find the post and upload part under “Core” heading.
Go to c:\xampp\php\
Find the file php.ini
Open php.ini in notepad
Find post_max_size and change value to 20M
Find upload_max_filesize and change value to 20M
Save the file
Logout out of your site backend.
Turn off apache and mysql on xampp and quit
Restart xampp as administrator
Turn on apache and mysql
Open browser and go to localhost
Open phpinfo and search for upload_max_filesize and post_max_size.
Confirm that changes are registered.
This can also happen with the following suhosin setting:
suhosin.upload.disallow_binary = On
Setting it to off temporarily allows you to upload zip files
If you use CPanel, search for PHP version (in the Software section) and click on it, then click on 'switch to PHP Options', the options will display then look for 'upload_max_filesize' and click on the value to change it. Do the same for 'post_max_size'.

How to access the php.ini file in godaddy shared hosting linux

I have a web, and running well on my localhost.
After I Upload on my godaddy hosting, My web got a bug. the conclusions is, I MUST change the memory_limit on the php.ini file, BUT cant find php.ini on FTP manager.
I have tried to:
Find the way for change to the Classing FTP manager.
Create / upload php.ini file from local and not work.
My Questions is : How I can Fix this? I Must change php.ini file.
does anyone have experience like me?
Create php.ini file with your desired setting and upload it in your root folder of server. It will take effect with this new setting.
You can't edit the php.ini file of godaddy server, but you can upload your own copy of your php.ini with your new setting.
This new setting will be available only to you. Other websites will not be affected with this new setting.
Previously I faced the same issue, but after doing this my problem was resolved.
Procedures:
Go to your CPanel
Select PHP version
Click on the link Switch to PHP options
Edit your configuration
don't forget to click save
You can also follow this screencast
https://www.youtube.com/watch?v=tdUlIkZcOe0
As pointed out by #Jason, for most shared hosting environments, having a copy of php.ini file in your public_html directory works to override the system default settings. A great way to do this is by copying the hosting company's copy. Put this in a file, say copyini.php
<?php
system("cp /path/to/php/conf/file/php.ini /home/yourusername/public_html/php.ini");
?>
Get /path/to/php/conf/file/php.ini from the output of phpinfo(); in a file. Then in your ini file, make your amendments
Delete all files created during this process (Apart from php.ini of course :-) )
To check whether your php.ini file takes effect, open a plain text editor and create a file called phpinfo.php. Insert the following line:
<?php phpinfo(); ?>
Save this file to the root of your Web site and then browse to yourdomain.com/phpinfo.php to test the settings.
Septiyo,
You need to create your own php5.ini file and upload it to your root directory. Using GoDaddy (as I do) you do not have control over the web/conf/ folder to make any changes to their version. Be sure if you're using PHP5 to name your file php5.ini or php.ini for PHP4. Upload it to your root folder, then restart your page, then check using phpinfo() to see if the directory of your php file has changed correctly.
For more information, check this link out.
http://www.ostraining.com/blog/coding/phpini-file/
if you don't have a good copy of your php5.ini file in your home directory (a predicament that I recently found myself in), you'll need to follow a little multi-step process to make your changes.
Create a little code snippet to look at the output of the phpinfo() call. This is simple, and there are multiple web-sites that describe this process.
Examine the output of phpinfo() for the row which contains Configuration File (php.ini) Path. Mine was in /usr/local/lib, but your's may be a different path (depends on hosting level purchased).
GoDaddy will NOT simply copy this file into your home directory for you --as silly as that sounds! But, you can write a little php program to copy this php.ini file into your home directory. The guy at
https://www.jabari-holder.com/blog/how-to-get-godaddys-php5-ini-file/
has a drop-box with this code snippet, if you care to use it. Just
take care to modify two things:
a. change the path you read 'from' to match the path you uncovered in Step 2.
b. change the output file-name to something of your choosing. You're going to re-name this file in a later step anyway. Let's call our copied file Foo.ini (but it can be anything).
Rename Foo.ini to .user.ini (for most GoDaddy account types).
Create a new php.ini file with your desired settings and upload it to public_html folder of your Godaddy Hosting Account.
By default, Godaddy doesn't allow to edit it's existing php.ini file. However, you can always upload your own copy of your php.ini file with your own settings.
Below is an example of a simple php.ini file with some custom values:
max_execution_time 600
memory_limit 128M
post_max_size 32M
upload_max_filesize 32M
I had this exact problem with my GoDaddy account.
I am running the Linux hosting with cPanel
follow these steps and you should be fine if you are running the same hosting as me:
first, go to you Manage Your Hosting -> Manage
then you will see a section called Files, click on File Manager
you can select the Document Root for: yourwebsite.com then click GO
this should bring you right away in the public_html folder
in that folder, you can add a file (by clicking the +File in top left corner), call it phpinfo.php
right click that new file, and select edit :
right this in it and save changes:
<?php phpinfo(); ?>
it the same public_html folder, add another file called php.ini
edit this one too, right those lines:
max_execution_time 600
memory_limit 128M
post_max_size 32M
upload_max_filesize 32M
now, go back to your Manage Your Hosting -> Manage, look for PHP Process
click Kill Process, this will allows a refresh with your new settings. you are good to go
side note: you can see your new settings by navigating to yourwebiste.com/phpinfo.php
I found a guide to reload the php5.ini file or load a new one right away. You will need to access your Godaddy hosting panel where you will find the option "system process" do a restart there and it will load the php5.ini or php.ini file right away.
2 external guides to assist you:
http://support.godaddy.com/help/article/5980/managing-system-processes-on-linux-hosting-accounts
http://www.studio-owens.com/blog/GoDaddy-and-Your-php-ini-File.htm
For some hosting accounts, I'm on Ultimate Classic Linux, the file name you need to use is .user.ini.
It's an older question, but if anyone has a problem with setting this, their documentation is outdated. I made a copy of the php.ini file named php5.ini and now it works.
Follow below if you use godaddy shared hosting..
its very simple:
we need to access root folder of the server via ftp, create a "php5.ini" named file under public_html folder... and then add 3 stupid lines... also "php5" because I'm using php5.4 for 1 of my client. you can check your version via control panel and search php version. Adding a new file with php5.ini will not hamper anything on server end, but it will only overwrite whatever we are commanding it to do.
steps are simple:
go to file manager..
click on public_html..
a new window will appear..
Click on "+"sign and create a new file in the name: "php5.ini" ... click ok/save. Now right click on that newly created php5.ini file and click on edit... a new window will appear... copy paste these below lines & click on save and close the window.
memory_limit = 128M
upload_max_filesize = 60M
max_input_vars = 5000
Not php.ini file, but a way around it. Go to GoDaddy's
Files > Backup > Restore a MySQL Database Backup
Choose your file and click Upload. No timeouts. Rename the DB if needed, and assign a user in
Databases > MySQL Databases

Setting PHP tmp dir - PHP upload not working

I'm working on file upload via a webpage with a progress bar using Valums file uploader. Almost everything works fine, but I'm not able to change the default tmp directory, where the file is stored during the upload.
Files should be stored in /upload directory and not in default system /tmp directory, because /tmp is mounted in a RAM disk which has its size limited to 4 MB and user will be uploading files around 10 MB.
I've searched lots of webpages, but none of solutions worked.
I've set temp directory in php.ini:
upload_tmp_dir =/upload
I've set permissions to the /upload dir, and apache is owner of the file, so the directory is definitely writable by PHP.
I've set the target path in file uploader to /upload, because I want the files to be stored after the upload also in this directory. The final result is small files are being uploaded successfuly, but files larger than 4 MB fail to upload-the only reason of this behaviour that comes to my mind is that files are stored in /tmp during upload. To be sure, I've checked it with sys_get_temp_dir() and the result was /tmp-so PHP ignores my php.ini directive or there is some other way to set where files are stored during upload.
Oh, and the last information: open_basedir isn't set, so the PHP access to disk is only limited by file permissions.
The problem described here was solved by me quite a long time ago but I don't really remember what was the main reason that uploads weren't working. There were multiple things that needed fixing so the upload could work. I have created checklist that might help others having similar problems and I will edit it to make it as helpful as possible. As I said before on chat, I was working on embedded system, so some points may be skipped on non-embedded systems.
Check upload_tmp_dir in php.ini. This is directory where PHP stores temporary files while uploading.
Check open_basedir in php.ini. If defined it limits PHP read/write rights to specified path and its subdirectories. Ensure that upload_tmp_dir is inside this path.
Check post_max_size in php.ini. If you want to upload 20 Mbyte files, try something a little bigger, like post_max_size = 21M. This defines largest size of POST message which you are probably using during upload.
Check upload_max_filesize in php.ini. This specifies biggest file that can be uploaded.
Check memory_limit in php.ini. That's the maximum amount of memory a script may consume. It's quite obvious that it can't be lower than upload size (to be honest I'm not quite sure about it-PHP is probably buffering while copying temporary files).
Ensure that you're checking the right php.ini file that is one used by PHP on your webserver. The best solution is to execute script with directive described here http://php.net/manual/en/function.php-ini-loaded-file.php (php_ini_loaded_file function)
Check what user php runs as (See here how to do it: How to check what user php is running as? ). I have worked on different distros and servers. Sometimes it is apache, but sometimes it can be root. Anyway, check that this user has rights for reading and writing in the temporary directory and directory that you're uploading into. Check all directories in the path in case you're uploading into subdirectory (for example /dir1/dir2/-check both dir1 and dir2.
On embedded platforms you sometimes need to restrict writing to root filesystem because it is stored on flash card and this helps to extend life of this card. If you are using scripts to enable/disable file writes, ensure that you enable writing before uploading.
I had serious problems with PHP >5.4 upload monitoring based on sessions (as described here http://phpmaster.com/tracking-upload-progress-with-php-and-javascript/ ) on some platforms. Try something simple at first (like here: http://www.dzone.com/snippets/very-simple-php-file-upload ). If it works, you can try more sophisticated mechanisms.
If you make any changes in php.ini remember to restart server so the configuration will be reloaded.
I struggled with this issue for a long time...
My solution was to modify the php.ini file, in the folder that contained the php script. This was important, as modifying the php.ini at the root did not resolve the problem (I have a php.ini in each folder for granular control).
The relevant entries in my php.ini looked like this.... (the output_buffering is not likely needed for this issue)
output_buffering = On
upload_max_filesize = 20M
post_max_size = 21M
create php-file with:
<?php
print shell_exec( 'whoami' );
?>
or
<?php echo exec('whoami'); ?>
try the output in your web-browser.
if the output is not your user example:
www-data
then proceed to next step
open as root:
/etc/apache2/envvars
look for these lines:
export APACHE_RUN_USER=user-name
export APACHE_RUN_GROUP=group-name
example:
export APACHE_RUN_USER=www-data
export APACHE_RUN_GROUP=www-data
where:
username = your username that has access to the folder you are using
group = group you've given read+write+execute access
change it to:
export APACHE_RUN_USER="username"
export APACHE_RUN_GROUP="group"
if your user have no access yet:
sudo chmod 775 -R "directory of folder you want to give r/w/x access"
My problem was selinux...
Go sestatus.
If Current mode: enforcing then chcon -R -t httpd_sys_rw_content_t /var/www/html
I was also facing the same issue for 2 days but now finally it is working.
Step 1 : create a php script file with this content.
<?php
echo 'username : ' . `whoami`;
phpinfo();
note down the username.
note down open_basedir under core section of phpinfo.
also note down upload_tmp_dir under core section of phpinfo.
Here two things are important ,
see if upload_tmp_dir value is inside one of open_basedir directory.
( php can not upload files outside open_basedir directory ).
Step 2 : Open terminal with root access and go to upload_tmp_dir location.
( In my case "/home/admin/tmp". )
=> cd /home/admin/tmp
But it was not found in my case so I created it and added chown for php user which I get in step 1 ( In my case "admin" ).
=> mkdir /home/admin/tmp
=> chown admin /home/admin/tmp
That is all you have to do to fix the file upload problem.
In my case, it was the open_basedir which was defined. I commented it out (default) and my issue was resolved. I can now set the upload directory anywhere.

changing php.ini settings on heart internet

I am trying to upload large files through my cms and was wondering how to change the php.ini file for heart internet.
Is this possible in shared hosting, if not are there any other work arounds?
Thanks in Advance
To override settings all you need to do is create either a php.ini or php5.ini file (if you are running PHP5) in your root directory. Then you can change settings like this:
upload_max_filesize = 20M ;
post_max_size = 20M ;
max_execution_time = 60 ;
This gives you maximum file size of 20MB and 60 second timeout.
As long as you keep this size within the allowed limits on your account, you can use this to increase the default size - which is 5MB.
It depends on whether your web hosting company allows you to override certain PHP settings or not. It might be possible to change some values but not others.
Secondly, the process for overriding settings differs depending on whether your hosting is IIS or Apache. If its Apache, try adding these two lines to your .htaccess file:
php_value upload_max_filesize 8M
php_value post_max_size 8M
This .htaccess file should do to the directory where your php upload script resides, or higher. I'd rather put it in the root directory.
Once done, create a php page containing this code:
<?php phpinfo( ); ?>
Compare the Local Value and Master Value of these settings to see if the changes are in effect.
There is no way to upload files over 50MB without breaking your terms and getting your account shutdown.
However if the terms were different, you could split the file into parts and join them together on the server side.
I moved away from heart internet and got my own server for this exact reason as they wouldn't even let me pay a premium to get the restriction removed (restricted from there end I think)
If it is shared hosting you probably won't be able to, I have also discovered that you cannot use ini_set to set the correct settings because the file upload occurs before your script is executed. So if you want to accept large files via a form to a PHP script you have to use php.ini.
You might be a work around though, you could use an open FTP account, upload large files form there and code a bit of script to ask the user what file they have uploaded, then you can manipulate (move / rename) to your hearts content.

Categories