1

Possible Duplicate:
PHP change the maximum upload file size

I use a free Web hosting service (Apache/2.2.17) on UNIX, I think . I use a php script to append data to some file in my home dir, with such code:

$my_handle = fopen($my_file_name, 'ab');
$bytes = fwrite($my_handle, $my_data);
fclose($my_handle);

When the file size reaches 128 MB, the script terminates, but no error is produced. So, I have to save data in 128 MB parts. Is there any way that I can change this "128 MB file size limit"?
Thanks!

Community
  • 1
  • 1
GreenBear
  • 373
  • 1
  • 6
  • 18
  • 1
    Are you sure, there's no error? Maybe error reporting is turned off? Check *error_reporting* and *display_errors* directives. – Crozin Nov 13 '12 at 01:44
  • Show us how your filling `$my_data` – Lawrence Cherone Nov 13 '12 at 01:47
  • Hi, Crozin! Thanks for the help! Usually I am getting a lot of errors when my scripts run before I debug them. I am not very experienced in php. But this error is not reported. The script just terminates and I end up with 128 MB file. – GreenBear Nov 13 '12 at 01:58
  • Hi, Vulcan. My question is not about upload file size limit, but about file system max file size limit, so, it does not seem to be a duplicate. The upload limit of my provider is 8 MB. – GreenBear Nov 13 '12 at 02:01
  • BTW, I checked the error_log file. There are errors there, but none of them pertaining the issue. – GreenBear Nov 13 '12 at 02:11

1 Answers1

1

You can change the configuration in the PHP settings but you won't have that option available on free hosting. Upgrade your hosting.

  • Hi, Chris Vickery! Thanks for the help. Could you please elaborate which setting exactly has to be changed? The service provider says that I "can change most of PHP settings yourself by using php_flag values in .htaccess file and ini_set(), ini_alter() PHP functions". – GreenBear Nov 13 '12 at 01:54
  • @GreenBear Refer to the accepted answer [here](http://stackoverflow.com/questions/2184513/php-change-the-maximum-upload-file-size). – FThompson Nov 13 '12 at 01:55
  • Vulcan, my question is not about upload limit. The upload limit of my provider is 8 MB. – GreenBear Nov 13 '12 at 02:03