Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Hadayat's avatar

Uploading laravel project on the server but it through an error

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
0 likes
46 replies
automica's avatar

@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.

Hadayat's avatar

How can I run this command on the server?

automica's avatar

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.

jlrdw's avatar

Make sure you are using the required PHP version for your version of laravel.

Hadayat's avatar

@jlrdw I am using 7.4, with Laravel-7 Please tell me, I need to install the composer on the server?

itsolutions's avatar

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()

automica's avatar

@hadayat are you running the same version of php7 on your local development environment as your remote server?

Hadayat's avatar

@automica I'm not sure about the server version because I'm using shared hosting Cpanel, I've no knowledge about the server configuration.

jlrdw's avatar

In cpanel there will be a choose PHP version, browse around the cpanel.

Hadayat's avatar

@jlrdw I updated the php version but now it throw another error

Deprecated: Directive 'allow_url_include' is deprecated in Unknown on line 0
Hadayat's avatar

If switched to PHP 7.3 it says "This page isn’t working"

jlrdw's avatar

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.

Jsanwo64's avatar

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?

Hadayat's avatar

@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.

Hadayat's avatar

@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
jlrdw's avatar

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.

Hadayat's avatar

@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?

jlrdw's avatar

allow_url_include = 0

For php 7.4 you shouldn't have that.

Double check what version you have.

Jsanwo64's avatar

In php.ini change track_errors=On to track_errors=Off

siangboon's avatar

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();
Jsanwo64's avatar

Also, double-check that you are not running PHP 7.2 .... that error seems to be common with PHP 7.2

Hadayat's avatar

@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's avatar

Great, try this then

In your php.ini change
 track_errors = On 
to
 track_errors = Off

Hadayat's avatar

@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'

Jsanwo64's avatar

Can you give a summary of how you uploaded your files to the live server?

Hadayat's avatar

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.

Jsanwo64's avatar

Check your htaccess file, do u see anything related to php version there?

Next

Please or to participate in this conversation.