Laravel Increase Upload file Size Heroku - laravel

It looks like I cannot upload more than 2mb file with heroku.
I can upload 3mb file on my local but I can't upload the same file after pushing to heroku. (Using storage S3)
I updated the htaccess file and I have added
ini_set('upload_max_filesize', '64M');
to my controller but it doesn't work.
Is there a way we can change the php.ini setting on heroku?

you need to create .user.ini file in root directory
post_max_size = 25M
upload_max_filesize = 25M
then also updated .Procfile for apache
web: vendor/bin/heroku-php-apache2 -i user.ini rootDirectoryName/
for more information read this blog and official documention

Had a similar issue, I was googling and trying many solutions, but nothing helped, so I've decided to switch from Apache to NGINX and the problem was solved - https://stackoverflow.com/a/69509235/7092969
Overriding Heroku PHP ini files is kinda complicated and official Herkou documentation did not help me at all :/

Related

Where is the /etc/nginx folder?

I'm getting a 413 Request Entity Too Large error when I try to upload a large image (~1MB) to my Laravel api. The solution everyone gives is to modify the /etc/nginx/nginx.conf file, but I canĀ“t seem to be able to find that file. Where is it exactly located? I'm using Windows 10 and Laravel 6.8.
There is no /etc/nginx/ directory on windows because this is a path in Linux operating system, in windows you either have installed XAMP or WAMP for both of them you need to increase upload_max_filesize and post_max_size in your php.ini file, follow this Article to change php.ini for XAMP and it's very similar to WAMP
"/etc/nginx" is for linux. In Windows maybe you are using Xampp (which uses Apache instead Nginx). You may not even be using Apache because you probably run the application with php artisan serve. I recommend you check php settings in for c:\xampp\php\php.ini (edit upload_max_filesize and post_max_size directives)
More info:
https://www.keycdn.com/support/413-request-entity-too-large

where the .env file goes on the web server in laravel 5.6

I am confused about .env file as when I hosted the laravel application the .env file is missing on the web server. If anybody knows the way how can we find .env file on the server please answer.
Try ls -la to list all files in your web root.
As other have said, it sounds like the file exists but you cannot see it because it is a hidden file (denoted by the . in .env)
For future reference, whilst .env is likely to be excluded in a .gitignore there is often a .env.example which is include that you can copy and modify for your environment.
By default a Laravel app's Git repo will ignore the .env file - it's because you will use this on your development machine to configure the app to work on that environment.
You should have another .env file on your server which provides the configuration required for your app to run in that environment. This file should be maintained between deployments - and most importantly, the credentials inside of it should not be tracked in a repo.
Your .env file is there! It is a hidden file and you can't see it with gui unless if you somehow reveal hidden files! I recommend you to use putty over windows or ssh over linux terminal and edit it if you know how to do that.
By default some files like .env, .htaccess are hidden on the server therefore to see these files we need to set as show hidden files on the server settings.

Magento2 on enable static asset signing - file not found

I am trying to deploy the static assets using the command:
php bin/magento setup:static-content:deploy
Also removed the var folder.
after that if I load the site in browser, the css, js files from source are not loaded.
for example the link in the source looks like this:
http://www.example.com/pub/static/version1503771754/_cache/merged/f02fb718e9807603b4bf524157f9fd9b.min.css
when I check the file physical location:
http://www.example.com/pub/static/_cache/merged/f02fb718e9807603b4bf524157f9fd9b.min.css
the file is very much there.
so the signing of the file is making it unreachable.
But If I disable the signing I am getting a 500 internal server error on backend.
any help will be much appreciated.
Problem resolved.
if anyone faces the same problem.
The file .htaccess was not correct. I downloaded the latest and correct version the file and put it in pub/static/ folder and run the command again also removed the var folder all caches.
This resolved the problem.

got 500 Internal Server error in joomla [duplicate]

I have installed new site in Joomla 1.7 and its working fine, but when i checked its back-end (administrator) got 500 Internal Server Error.
Note: Site is working fine in Local server.
Please suggestion me any solution.
Thanks in advance.
First you have change folder permission to 775 for the following folders:
cache, logs, tmp & administrator/cache
then go to: configuration.php
find code:
$log_path = 'XXXXXXXXXXXXX';
$tmp_path = 'XXXXXXXXXXXXX';
and change code into:
$log_path = './logs';
$tmp_path = './tmp';
problem solved :)
I had this problem, but none of your advices didn't help.
I fixed a problem only after I switched off all modules via PhpMyAdmin (PMA).
Table modules, changed parameter "published" to 0 for all and then enabled only few modules with these types:
mod_login
mod_menu
mod_sumbenu
mod_toolbar
mod_title
After this I entered admin page and used top menu to enable all needed modules one by one. After admin page started to give me 500 error again I knew what module is faulty and I disabled it again via PMA.
May be some files are not uploded.Check failed transfer of your FTP server.Make sure all the files are uploded online
Check your error logs and backtrace what is causing the error. It sounds like you have MySQL errors, make sure any of your components/modules/aren't tricking out your site.
Think it's a component?
You can login into PHPMyAdmin and disable/enable modules manually by unpublishing them using the table editor, changing isPublished to 0 .
Try reinstalling database with the correct compatibility and also check web.config file on ftp for correct configuration paths !
I experienced something similar on my site. Digging through the log file, /administrator/error_log i saw this error message:
[08-Oct-2012 15:28:59] PHP Fatal error: Call to a member function login() on a non-object in /home/XXX/public_html/administrator/components/com_login/admin.login.php on line 65 .
Problem was, i had a previous installation of Joomla 1.5.x, and uploaded files for Joomla 1.6 to replace the previous files and upgrade security of the site. Took me almost a month to find a solution for my own case;
Finally found out from this website that I needed to completely delete all previous files in the website root directory before uploading a new version of Joomla.
Hope this helps someone out there who is in the same situation!
I also have the same issue on my site backend when editing or saving some articles, modules etc...Finally i solved it...
Add these lines to /etc/httpd/conf.d/mod_secuirity.conf on your server
SecRuleEngine Off
save it...and restart apache...it works fine for me.
Adding these lines disable mod_secuirity engine off.I don't know if it causes secuirity problems in future..
Tnx all...
Change the permission of folder administrator at 775 or 755
I tried all the above ideas. Without avail. For my site (which was an outdated Joomla 1.5.x site- don't ask!!!), where the backend suddenly stopped working, the final solution was switching the servers PHP version from 4 to 5.5 (even 5.4 did not work!).
I then got some strange PHP warnings in the frontend. But I then updated Joomla from the now again working backend to the last 1.5 version and everything worked fine from the on.
Phew! Maybe this helps someone later on...
In my case there was a single file with bad permissions.
It can be tricky to figure out which file has the problem so just run this to set the permissions for all the files in the directory:
chmod -R ug+rwX .
chmod -R o+rX .
Change the permissions of all of your files/directories.
Files should be 755
Directories should be 644
This is my case and my solution:
I have changed my server and got this error. I have protected my administrator folder using password protection method. So I have checked my new server and found that my protection information are not saved in control panel. also my .htaccess file (in administrator folder) is not compatible to my new server.
The solution:
Simply protect my folder using control panel
I have renamed the .htaccess file to htaccess.txt
It is done.
I hope it could be useful ;)

500 internal server error at back end - Joomla

I have installed new site in Joomla 1.7 and its working fine, but when i checked its back-end (administrator) got 500 Internal Server Error.
Note: Site is working fine in Local server.
Please suggestion me any solution.
Thanks in advance.
First you have change folder permission to 775 for the following folders:
cache, logs, tmp & administrator/cache
then go to: configuration.php
find code:
$log_path = 'XXXXXXXXXXXXX';
$tmp_path = 'XXXXXXXXXXXXX';
and change code into:
$log_path = './logs';
$tmp_path = './tmp';
problem solved :)
I had this problem, but none of your advices didn't help.
I fixed a problem only after I switched off all modules via PhpMyAdmin (PMA).
Table modules, changed parameter "published" to 0 for all and then enabled only few modules with these types:
mod_login
mod_menu
mod_sumbenu
mod_toolbar
mod_title
After this I entered admin page and used top menu to enable all needed modules one by one. After admin page started to give me 500 error again I knew what module is faulty and I disabled it again via PMA.
May be some files are not uploded.Check failed transfer of your FTP server.Make sure all the files are uploded online
Check your error logs and backtrace what is causing the error. It sounds like you have MySQL errors, make sure any of your components/modules/aren't tricking out your site.
Think it's a component?
You can login into PHPMyAdmin and disable/enable modules manually by unpublishing them using the table editor, changing isPublished to 0 .
Try reinstalling database with the correct compatibility and also check web.config file on ftp for correct configuration paths !
I experienced something similar on my site. Digging through the log file, /administrator/error_log i saw this error message:
[08-Oct-2012 15:28:59] PHP Fatal error: Call to a member function login() on a non-object in /home/XXX/public_html/administrator/components/com_login/admin.login.php on line 65 .
Problem was, i had a previous installation of Joomla 1.5.x, and uploaded files for Joomla 1.6 to replace the previous files and upgrade security of the site. Took me almost a month to find a solution for my own case;
Finally found out from this website that I needed to completely delete all previous files in the website root directory before uploading a new version of Joomla.
Hope this helps someone out there who is in the same situation!
I also have the same issue on my site backend when editing or saving some articles, modules etc...Finally i solved it...
Add these lines to /etc/httpd/conf.d/mod_secuirity.conf on your server
SecRuleEngine Off
save it...and restart apache...it works fine for me.
Adding these lines disable mod_secuirity engine off.I don't know if it causes secuirity problems in future..
Tnx all...
Change the permission of folder administrator at 775 or 755
I tried all the above ideas. Without avail. For my site (which was an outdated Joomla 1.5.x site- don't ask!!!), where the backend suddenly stopped working, the final solution was switching the servers PHP version from 4 to 5.5 (even 5.4 did not work!).
I then got some strange PHP warnings in the frontend. But I then updated Joomla from the now again working backend to the last 1.5 version and everything worked fine from the on.
Phew! Maybe this helps someone later on...
In my case there was a single file with bad permissions.
It can be tricky to figure out which file has the problem so just run this to set the permissions for all the files in the directory:
chmod -R ug+rwX .
chmod -R o+rX .
Change the permissions of all of your files/directories.
Files should be 755
Directories should be 644
This is my case and my solution:
I have changed my server and got this error. I have protected my administrator folder using password protection method. So I have checked my new server and found that my protection information are not saved in control panel. also my .htaccess file (in administrator folder) is not compatible to my new server.
The solution:
Simply protect my folder using control panel
I have renamed the .htaccess file to htaccess.txt
It is done.
I hope it could be useful ;)

Resources