@hadayat best to run
composer install
directly on your server rather than deploying the vendor directly. that will prevent any internal issues with vendor files, like you are seeing.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I throw an error in my vendor folder, I don't know why it's throwing this error, If anyone helps me I very thank full to you.
Parse error: syntax error, unexpected ':', expecting '{' in /home4/truepower/public_html/UOM/vendor/symfony/polyfill-php80/bootstrap.php on line 23
@hadayat best to run
composer install
directly on your server rather than deploying the vendor directly. that will prevent any internal issues with vendor files, like you are seeing.
How can I run this command on the server?
ssh onto the server and run it in the root of your site. if you don't have composer installed, you can ask your isp to install it for you.
Make sure you are using the required PHP version for your version of laravel.
@jlrdw I am using 7.4, with Laravel-7 Please tell me, I need to install the composer on the server?
@hadayat details on how to install composer are on the following link
are you 100% sure that you are using PHP 7.4 ? . Your error occours because of colon that sets the return type of a function. This functionality has been added since 7.4 . So you uploaded the vendor folder by hand, you haven't run composer install. I would ensure that I'm using 7.4 with the output of phpinfo()
@itsolutions My Php version is 7.4.8 and my Laravel version is 7.22.4
@hadayat are you running the same version of php7 on your local development environment as your remote server?
@automica I'm not sure about the server version because I'm using shared hosting Cpanel, I've no knowledge about the server configuration.
In cpanel there will be a choose PHP version, browse around the cpanel.
@jlrdw I updated the php version but now it throw another error
Deprecated: Directive 'allow_url_include' is deprecated in Unknown on line 0
If switched to PHP 7.3 it says "This page isn’t working"
Re-read the installation instructions for laravel meaning the system requirements make sure you have all extensions that it requires. Unclick the above one. And you might as well choose PHP 7.4 if available. Just suggestion.
There should be the place you click in the cpanel to choose what extensions you need.
Change the php version of your live server then re-up load the files again. You can also check the following in your cpanel landing page after you login. Home »Software »MultiPHP Manager" >> "allow_url_include " be set to disabled?
@jsanwo64 I disabled the functionality of deprecated version as
allow_url_include = off
My PHP.ini file contain above the line but when I execute phpinfo() function it shows that your allow_url_include in On. How can I solve this issue.
@jlrdw you are right, now I switched to the 7.4 version for my subdomain. Also I disable the allow_url_include=off but it still says
Deprecated: Directive 'allow_url_include' is deprecated in Unknown on line 0
Your cpanel doesn't have the check boxes where you can check or uncheck the extensions you need.
if you set it to production and turn off debug is the warning still there.
It's just a deprecated notice.
@jlrdw I don't have checkboxes to select. I saw it on other hosting but now this one does not exist checkboxes.
Is there any other way to solve this issue?
allow_url_include = 0
For php 7.4 you shouldn't have that.
Double check what version you have.
In php.ini change track_errors=On to track_errors=Off
for your information, CLI php and web php version may be different.... I'm not sure how you update the php version but in cPanel there may allow you to chose which php version to use... however, to double check your php version, create a file under the public_html root folder and name it info.php or whatever name you like, insert the code and then try access it from the browser, http://www.yourdomainname.com/info.php
<?php
phpinfo();
Also, double-check that you are not running PHP 7.2 .... that error seems to be common with PHP 7.2
@siangboon I am using the PHP 7.4.8 on my localhost and my server version is 7.4.9, There is no option for 7.4.8 in Cpanel.
I think this fine
@jsanwo64 Am very sure am using 7.4
Great, try this then
In your php.ini change
track_errors = On
to
track_errors = Off
@jsanwo64 Already tried but still same issue
When I'm running phpinfo() and check the status of allow_url_include
Local Value= ON
Master Value= ON
I think allow_url_include is not disabled by this command allow_url_include='off'
Can you give a summary of how you uploaded your files to the live server?
Yes sure, I am using Cpanel so I opened my Cpanel then I go to the file manager and open the public_html directory and paste my UOM folder in it, after this I moved two files (index.php, .htaccess) files into the root directory of my folder UOM. Then I go to the PHP manager into the Cpanel and change the current version of PHP 5.4 to 7.4 Then I change the path of vendor and bootstrap files in the index.php. That's it.
Check your htaccess file, do u see anything related to php version there?
Please or to participate in this conversation.