laravel error 500 (browser) after change of php version - laravel

Yesterday I had to update the version of PHP 7.4 to 8.0.13.
Since then, when I access my site, I get a 500 (browser) error.
The error occurs on the line:
require __DIR __. '/ .. / vendor / autoload.php';
in the public / index.php file.
Does anyone have (any idea please? please
I have already tried all the basic commands:
php artisan config: clear
php artisan cache: clear
compose dump-autoload
...
delete the vendor directory and recreate it
...
check the rights on the directories
UPDATE 10:13
I just saw in /var/logs/apache2/error.log
PHP Fatal error: Allowed memory size of 2097152 bytes exhausted (tried to allocate 32768 bytes) in /var/www/welrdv/vendor/composer/autoload_static.php on line 2501
UPDATE 10:18
I didn't have it before but I put memory_limit = -1 in /Etc/php/8.0/apache2/php.ini.
Is this the correct method?

memory_limit = -1 is a value PHP understands as unlimited. It can use up most of the RAM and even swap to disk. This could be useful only in dev environments to test purposes.
Just increase this value enough: memory_limit = 128MB

Related

Getting issue when install composer Laravel 7 Image Intervention

I want to install Laravel 7 Image Intervention using following command
composer require intervention/image
but while installing i am getting three errors belows
1) PHP Fatal error: Allowed memory size of 1610612736 bytes
exhausted (tried to allocate 4096 bytes)
phar://C:/xampp/htdocs/magento2/composer.phar/src/Composer/DependencyResolver/RuleWatchGraph.php on line 52
2)Check
https://getcomposer.org/doc/articles/troubleshooting.md#memory-
limit-errors for more info on how to handle out of memory errors.
3)Fatal error: Allowed memory size of 1610612736 bytes exhausted
(tried to allocate 4096 bytes) in phar://C:/xampp/htdocs/magento2/composer.phar/src/Composer/DependencyResolver/RuleWatchGraph.php on line 52
I dont know why this happen? If anyone have idea then please let me know.
Please help me in this
try put memory_limit = -1
at php.ini on your local server

I am confused on what this error message says on my code igniter website

Warning: Unknown: open_basedir restriction in effect. File(/home/mk6g6obzufkw/mywebsite.com/index.php) is not within the allowed path(s): (G:/PleskVhosts//autismfights.com\;C:\Windows\Temp\) in Unknown on line 0
Warning: Unknown: failed to open stream: Operation not permitted in Unknown on line 0
Fatal error: Unknown: Failed opening required '/home/mk6g6obzufkw/mywebsite.com/index.php' (include_path='.:/opt/alt/php56/usr/share/pear:/opt/alt/php56/usr/share/php') in Unknown on line 0
I did check index.php but I don't see any problem in that. How can I get more detail about error. I am not expert in code igniter but yes I am beginner.
This is caused due to Server Settings.
1. Open your cPanel
2. Navigate to PHP Settings
3. Search for Common Settings
4. Check for `open_basedir`
5. Set value as `none`
6. Save the settings
The PHP script is trying to access the folder for which access is not allowed. This restriction is limited by the PHP open_basedir variable for each virtual host separately. By default, open_basedir is set to allow access for PHP files to the tmp and HTTP public directories.
So, you have either upload to the wrong folder on the server, set some php.ini value wrong, the host provider has not set up the virtual host correctly, or you have asked CodeIgniter to find a file in somewhere it doesn't have permission read/write/execute.

502 Connection reset by peer when apply discount code - Magento 2

I am facing the 502 related error by applying the coupon code when we are on checkout page payment step and getting below error with browser console.
Error : NetworkError: 502 Connection reset by peer - {site_url}/rest/default/V1/guest-carts/2439a83d3603facae410aeec2b122b1a/coupons/aaa
I've applied some solutions for the nginx server as below but not resolved my issue.
Changed some nginx server configuration with fields.
fastcgi_connect_timeout, fastcgi_send_timeout, fastcgi_read_timeout
Other Magento API works perfect for overall site, Is there any server configuration issue which I am missing?
We are using Magento with nginx.
Any help would be appreciate !!!
Thanks.
Check your php.ini file or opcache.ini file and try increasing the caching memory like this (by default should be 64 or 128)
[opcache]
opcache.memory_consumption = 512
Try setting this in nginx.conf:
worker_rlimit_nofile 65535;
keepalive_requests 1024;
keepalive_timeout 10s;
In /etc/security/limits.conf add at the end of the file:
nginx soft nofile 10000
nginx hard nofile 70000
In /etc/sysctl.conf (save the file & run sysctl -p after that so you'll activate the changes):
fs.file-max = 209708
Try settting something like this in php-fpm.d/ for the desired pool (in my case it's /etc/php-fpm.d/www.conf
pm = dynamic
pm.max_children = 100
pm.start_servers = 15
pm.min_spare_servers = 5
pm.max_spare_servers = 50
pm.process_idle_timeout = 90s
pm.max_requests = 4096
Restart nginx, restart php-fpm and check if you see any improvement

Getting Allowed memory size error on sample data deployment magento2

I am trying to install sample data using magento 2 command line utility. But getting blow error when in run "php magento sampledata:deploy" from php command line.
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 8388608 bytes) in sionParser.php on line 230
Anyone faced similar error? please suggest me how to resolve it.
You can do this using command,
php -dmemory_limit=6G bin/magento setup:static-content:deploy
where 6G you can change it.
I have same problems. Its working fine now.
Unfortunately, the official Magento 2 documentation does not state in clearly, but you need at least 768 megabytes of RAM per a Magento 2 PHP process:
http://devdocs.magento.com/guides/v2.0/install-gde/prereq/php-ubuntu.html#instgde-prereq-timezone
http://devdocs.magento.com/guides/v2.0/install-gde/prereq/php-centos.html#instgde-prereq-timezone
https://github.com/magento/magento2/blob/2.0.0/.htaccess#L40

Magento 1.4.1.1 ::: Exporting Products Leads to Fatal Error

I am exporting around 1200 products to csv via Magento's export profile feature.
The export begins and then locks up.
php has this to work with:
max_execution_time 28000
memory_limit 1024M
I get this error:
[Wed Mar 23 12:48:33 2011] [error] [client 84.229.93.19] PHP Fatal
error: Allowed memory size of 1073741824 bytes exhausted (tried to
allocate 24 bytes) in
/path/to/lib/Zend/Db/Adapter/Pdo/Abstract.php on
line 292, referer:
http://domain.com/index.php/admin/system_convert_profile/edit/id/10/key/598b0f0c45b13aba68a3fbe2b06a4d85/
Now, I know Magento 1.4.1.1 has a memory leak that directly affects this process,a nd I applied a patch to treat the issue:
http://blog.ewtechnologies.com/magento-2/magento-memory-leak-1-4-1-1/
But I still have this problem.
Does anyone have any other insights into this? Even if upgrading to 1.5.x will help?
Just increase the memory for php until it succeeds as it buffers all the data to memory and is somewhat stupidly implemented

Resources