how to fix finfo error in Laravel production? - laravel

I am getting this error when I am using Storage::URL() in my laravel App in cPanel and I have installed the fileinfo extension

You must enable fileinfo extension in php.ini as well.
If you are using cPanel, you can check here: https://www.shorttutorials.com/control-panel/enable-php-fileinfo-extension.html

Related

Unable to guess the MIME type as no guessers are available. How do I install php_fileinfo extension in cPanel?

I'm trying to upload an image with validation:
'image|mimes:jpeg,png,jpg,gif,svg|max:2048'
Works fine on local. But fails on cPanel.
The cPanel version is 90.0.6
I've tried a couple things inside cPanel. But I couldn't figure out how do I enable the fileinfo extension.
Please help.
Sorry, couldn't comment due to profile limitations that's why posting it in the answer section.
You can contact your hosting provider and ask them to enable the extension for you. There is no way to enable it by yourself in shared hosting.
Make sure your host provider added the extension file in their PHP config.
You can enable fileinfo extension from Cpanel,
Kindly Go to Software => Select PHP Version =>
enable the check box fileinfo to use fileinfo extension.
You should enable the following line in your php.ini and then restart your apache
extension=php_fileinfo.dll
Enabling mean just uncomment the line in your php.ini file
i.e: From this ;extension=php_fileinfo.dll to extension=php_fileinfo.dll
just remove (;) and save it then restart your apache.

Restiction in directory when deploy laravel app. open_basedir restriction for lang directory

I tried to deploy a laravel web in Windows server 2018. At the moment that I load the webpage error 500.
The log file said:
PHP Fatal error: Uncaught ErrorException: file_exists(): open_basedir restriction in effect. File(C:\inetpub\vhosts\my-web.com\resources\lang/de.json) is not within the allowed path(s): (C:/Inetpub/vhosts/my-web.com\;C:\Windows\Temp) in C:\inetpub\vhosts\my-web.com\vendor\laravel\framework\src\Illuminate\Filesystem\Filesystem.php:23
I tried to give all permissions in Plesk but doesn't help. I tried to print a simple "Hello world" and it works. Do I miss something?
I also did the recommendation from Plesk without success.
https://support.plesk.com/hc/en-us/articles/115000278993-A-website-hosted-in-Plesk-is-not-accessible-open-basedir-restriction-in-effect-File-is-not-within-the-allowed-path-s-
PHP version 7.3.14
Laravel 6
In Plesk go to php settings and add :{WEBSPACEROOT} to the open_basedir so laravel can access to file in root.

WAMP requires curl.cainfo certficate in order to work with Pusher

I'm working in WAMP and Laravel on localhost. I was trying to broadcast an event using Pusher to my font end and Laravel was throwing an exception. I fixed the issue by downloading cainfo certficate from curl official website and setting curl.cainfo variable in php.ini to point to downloaded certificate. I was wondering why is this required? Is this only for WAMP or only for Pusher? Or it's because Pusher is using HTTPS?
Is it only for the PHP you're using in your Wamp to connect with services who requires SSL..
- download it from here: https://curl.haxx.se/docs/caextract.html
- Add it to your ssl folder in your php version, and modify your php.ini files (in Wamp folder and PHP folder):
curl.cainfo = "C:\wamp\bin\php{php_version}\extras\ssl\cacert.pem"

Laravel errors gone

enter code hereHi all my on windows 7(so i don't have any folder permissions) I have can't see Laravel error anymore. It worked fine yesterday.
why? what's wrong?
Laravel version 5.1 and web server wamp lastest version.
I found this link
but can't find file - storage/meta/compiled.php
this command also not working for me - php artisan optimize
also debug = true in .env and app.php files
please help
If you read the installation documentation you will find the following information:
After installing Laravel, you may need to configure some permissions. Directories within the storage and the bootstrap/cache directories should be writable by your web server. If you are using the Homestead virtual machine, these permissions should already be set.

Upload a Laravel 4.2 project on bytehost

I have uploaded my Laravel 4.2 project (using Filezilla) which is stored in folder name main-Laravel into the htdocs folder on bytehost.when I tried accessing it like this http://bcms.byethost8.com/main-laravel/public/, I an error saying Fatal error: require(): Failed opening required '/home/vol12_4/byethost8.com/b8_16140412/htdocs/main-laravel/bootstrap/../../main-laravel/vendor/autoload.php' (include_path='.:/usr/share/pear/') in /home/vol12_4/byethost8.com/b8_16140412/htdocs/main-laravel/bootstrap/autoload.php on line 17. I did not have this problem when working on my local machine, so what can I do to resolve this problem and thanks in advance.
You will need to do additional setup to get Laravel working on a shared hosting.
Laravel needs composer to get the autoloading right and few other requirements to be run (such as higher PHP version, several PHP extensions & so on).
Here you can find more info:
http://laravel-tricks.com/tricks/setup-laravel-4-in-shared-hosting-with-securing-laravel-base-file

Resources