Request Entity Too Large issue - laravel-5

i have laravel application hosted on godaddy, i have multipe image upoader in form , when using small size images it work fine , but when add only one image of size 1 mb i got "Request Entity Too Large message" i have tied many solution like add php.ini file or even user.ini to public_html folder with this contents
file_uploads = On
upload_max_filesize = 256M
post_max_size = 257M
max_input_time = 300
max_execution_time = 300
max_file_uploads = 20
for both file but unfortunately still get the same error

I think you can't change the php.ini settings on GoDaddy shared hosting, but give this a try:
post_max_size xxM # change xxM to whatever you need

Related

Laravel returns unauthenticated but keeps running request

I have an API that I can export multiple data with relations, but I just buy a new server, and in this server when I make request with a big json it reachs the route file twice and returns Unauthenticated (it should'nt cause its just one request and I don't make any redirects), with a smaller json it doesn't happens.
But even return unauthenticated I can see in my logs that the request keeps runing
That is my server configs
memory_limit = 200M
max_execution_time = 600
max_input_time = 600
post_max_size = 200M
upload_max_filesize = 200M
display_errors = On
display_startup_errors = On
default_socket_timeout = 600
max_user_connections = 1000
UPDATE
weird thing, when I add an dump('test') in some part of my controller, it doesn't return the unauthenticated exception and at the final of the request returns the json of success
Are you sending any data in the request header ?
add to root .htaccess hope this will work.
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

Laravel 4 - getting 500 Error when uploading large dimension image

When I am uploading large dimension photo (5625 * 5000 and size is 2MB) I got 500 error and if I reduce the dimension of this image then it uploads successfully..why is it happening? I am on GoDaddy server. please guide me through this.
My PHP.ini settings
max_execution_time = 1000
max_input_time = 1000
memory_limit = 500M
post_max_size = 1000M
upload_max_filesize = 1000M
Okay and I have troubleshooted the problem.. When I create a thumb it shows error, but when I remove that code it saves the image
My code to create thumb
anybody can explain why is it happening.. and how to get rid of it.
$img = Image::make($path.$name);

how to increase response time in laravel 5.2?

when filling a form in the software then if it takes more than 5 or 6 minutes it gives me an error like XML HTTP request response. Is there any way to increase the response time. The users of my software are very slow in writing.
please help me......
Place this at the top of your PHP script(php.ini file) and let your script loose!
ini_set('max_execution_time', 300); //300 seconds = 5 minutes
After this, restart your local server
Place beloved code in .htaccess to increase it,
<IfModule mod_php5.c>
php_value max_execution_time 300
</IfModule>

Magento Error when uploading a downloadable products

I first was getting a max_upload_size issue, which I resolved by modifying php.ini. I have increased it to 50M and I am getting a weird red box in Magento with no popup describing the error. Does anyone have any experience with this error?
The log shows:
2013-09-10T19:37:27+00:00 ERR (3): Strict Notice: Only variables should be passed by reference in /home/username/public_html/includes/src/__default.php on line 56826
Image showing error is here - http://s13.postimg.org/yb0my66t3/uploaderror.jpg
Ended up being another php.ini setting that Magento didn't error handle
Changed post_max_size to 30M
; Maximum size of POST data that PHP will accept.
post_max_size = 30M

Size of data scraped using ruby mechanize

agent = Mechanize.new
url = "---------------------------"
page = agent.get(url)
Now, I want to know the KB(kilobytes) of data that has been used by my internet service provider to scrape that data.
More specifically, whats the size in KB, of the variable "page"?
page.content.bytesize / 1024.0
It's really two separate things. The size of unzipped response body and the amount of bytes that were transferred. You can get the first by inspecting page.body, for the second you would need to measure response and request headers as well as account for things like gzip and redirects. Not to mention dns lookups, etc.

Resources