2
votes

I am new to laravel and I run my website on localhost. It runs correctly but when I upload it on cpanel, it raises these errors :

Warning: require(/home/didfilei/public_html/app/vendor/composer/../symfony/polyfill-mbstring/bootstrap.php): failed to open stream: No such file or directory in /home/didfilei/public_html/app/vendor/composer/autoload_real.php on line 66

Warning: require(/home/didfilei/public_html/app/vendor/composer/../symfony/polyfill-mbstring/bootstrap.php): failed to open stream: No such file or directory in /home/didfilei/public_html/app/vendor/composer/autoload_real.php on line 66

Fatal error: require(): Failed opening required '/home/didfilei/public_html/app/vendor/composer/../symfony/polyfill-mbstring/bootstrap.php' (include_path='.:/opt/cpanel/ea-php71/root/usr/share/pear') in /home/didfilei/public_html/app/vendor/composer/autoload_real.php on line 66

3
Did you run "composer install" on your web host after copying over your project?D. Simmons
i upload '/vendor' with project and in localhost i run composer install but said to me that 'nothing to update or install'MohamadReza Davoudi
Are the php versions for localhost and your shared server the same? Have you verified that your vendor upload worked i.e. checked for the existence of bootstrap.php?Cerad
my php version in localhost is '7.1.9' and in cpanel is '7.1.18', is this correct?MohamadReza Davoudi
The versions are close enough though in general you should try to have your localhost match exactly. Looks like your vendor directory did not upload correctly. Would not be surprised if, after sorting the vendor issue, you encountered more problems with file permissions and such. You could actually save yourself a tremendous amount of effort by using a cloud server such as digital ocean. Good luck.Cerad

3 Answers

4
votes

I solved it. I realized that after extracting the zip file with cpanel, some folders were deleted (eg '/ symfony'), so I got more space from the hosts, then my project extract correctly

2
votes

Since you do not have access to SSH, you should upload the vendor files along with the rest of your project. Be careful that if your dev machine is windows, you might face some issues with paths and case sensitivity.

You also need to check how php is executed in your host. You might have to fiddle around with file ownership and access rights. Especially if suphp is used, your user must be the owner of everything in your folder, all files must be set to 644 and all folders to 755

1
votes

SSH into your server and run composer update in the root of your project. This will pull in the required vendor files that you are missing.