Bobcares

Install Laravel on DirectAdmin – Quick way to do and fix errors

by | Dec 11, 2019

Wanna install Laravel on DirectAdmin as a PHP framework? We can install it for you.

Laravel is considered as one of the best PHP Frameworks. Because it provides incredible features such as easy database migration, simple authentication techniques, security within its framework, etc.

However, installing Laravel on DirectAdmin needs expertise as it needs Linux knowledge.

At Bobcares, we often get requests to install Laravel on DirectAdmin as part of our Server Management Services.

Today, let’s get into the details and see how our Support Engineers install Laravel on DirectAdmin and fix related errors.

How to install Laravel on DirectAdmin

Laravel is a popular, open-source PHP web application framework. Here, let’s see how our Support Engineers install Laravel on DirectAdmin.

1. Firstly, we login to the server via SSH as a root user. Then, we update the system and install the necessary packages with the following commands.

yum update

yum install -y git curl

2. Next, we install the composer by using the below commands. Because it is a dependency manager for PHP with which you can install packages.

curl -sS https://getcomposer.org/installer | php
mv composer.phar /usr/local/bin/composer

3. Before installing Laravel, we delete the default files created by DirectAdmin and switch to the domain root directory by using the following commands.

rm -rf /home/USERNAME/domains/LARAVEL_DOMAIN_NAME/public_html/*

cd /home/USERNAME/domains/LARAVEL_DOMAIN_NAME/public_html/

4. Then, we install Laravel using the composer create-project command.

composer create-project --prefer-dist laravel/laravel

5. Also, we make sure that whether ownership and permissions are given correctly or not.

chown -R USERNAME:USERNAME /home/username/domains/LARAVEL_DOMAIN_NAME/public_html/

6. After that, we configure DirectAdmin. For that, we login to the DirectAdmin as an admin user and go to Extra Features section >> select Custom HTTPD Configurations.

7. We select the domain on which Laravel needs to install. Then, we edit the webserver configuration as change it from public_html to public. Because it required by Laravel.

So, we add the following lines in the “Httpd.conf Customization for” text-area

|?DOCROOT=`HOME`/domains/`DOMAIN`/public_html/public|

8. Finally, we click on the Save button to update the changes.

That’s it

 

How we fixed the common errors

At Bobcares, where we have more than a decade of expertise in managing servers, we see many customers face problems while managing DirectAdmin servers.

Now, let’s see the major reasons for this Laravel related errors and how our Support Engineers fix the top errors.

 

PHP incompatibility

Recently, one of our customers had a problem with Laravel in the DirectAdmin server. He was getting an error after he set doc root to /home/mydir/domains/domain.com/public_html/public.

The error occurred as he attempted to access domain.com,

500 Internal Server Error

On checking, our Support Engineers found an entry while checking the error log /var/log/httpd/domains/domain.com.error.log. It showed as,

PHP Parse error: syntax error, unexpected '[' in /home/mydir/domains/domain.com/public_html/vendor/laravel/framework/src/Illuminate/Support/helpers.php on line 411

Then, we checked the version of PHP that running on the webserver and found that the problem was related to his PHP version. He was using an old PHP version, Laravel 5.6.

So, we switch the PHP version from php5.6 to php7.1.

Now,  Laravel worked fine without any error in the domain.

In short, the Laravel version should compatible with the PHP version. Otherwise, it will give 500 Internal Server Error.

 

Problem with permissions

Sometimes, customers may face problems after installing Laravel on the DirectAdmin server. Because they may forget to change the ownership of the Laravel document root. So, our Support Engineers make sure that the given ownership and permissions are correct

If not, we change it as follows.

chown -R USERNAME:USERNAME /home/username/domains/LARAVEL_DOMAIN_NAME/public_html/

 

[Need assistance to install Laravel on DirectAdmin? We’ll help you.]

 

Conclusion

In short, Laravel is an open-source PHP web application framework. However, incorrect directory permissions and PHP compatibility block the proper working of Laravel. Today, we saw how to install Laravel on DirectAdmin and how our Support Engineers fixed related errors.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

var google_conversion_label = "owonCMyG5nEQ0aD71QM";

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Never again lose customers to poor
server speed! Let us help you.

Privacy Preference Center

Necessary

Necessary cookies help make a website usable by enabling basic functions like page navigation and access to secure areas of the website. The website cannot function properly without these cookies.

PHPSESSID - Preserves user session state across page requests.

gdpr[consent_types] - Used to store user consents.

gdpr[allowed_cookies] - Used to store user allowed cookies.

PHPSESSID, gdpr[consent_types], gdpr[allowed_cookies]
PHPSESSID
WHMCSpKDlPzh2chML

Statistics

Statistic cookies help website owners to understand how visitors interact with websites by collecting and reporting information anonymously.

_ga - Preserves user session state across page requests.

_gat - Used by Google Analytics to throttle request rate

_gid - Registers a unique ID that is used to generate statistical data on how you use the website.

smartlookCookie - Used to collect user device and location information of the site visitors to improve the websites User Experience.

_ga, _gat, _gid
_ga, _gat, _gid
smartlookCookie
_clck, _clsk, CLID, ANONCHK, MR, MUID, SM

Marketing

Marketing cookies are used to track visitors across websites. The intention is to display ads that are relevant and engaging for the individual user and thereby more valuable for publishers and third party advertisers.

IDE - Used by Google DoubleClick to register and report the website user's actions after viewing or clicking one of the advertiser's ads with the purpose of measuring the efficacy of an ad and to present targeted ads to the user.

test_cookie - Used to check if the user's browser supports cookies.

1P_JAR - Google cookie. These cookies are used to collect website statistics and track conversion rates.

NID - Registers a unique ID that identifies a returning user's device. The ID is used for serving ads that are most relevant to the user.

DV - Google ad personalisation

_reb2bgeo - The visitor's geographical location

_reb2bloaded - Whether or not the script loaded for the visitor

_reb2bref - The referring URL for the visit

_reb2bsessionID - The visitor's RB2B session ID

_reb2buid - The visitor's RB2B user ID

IDE, test_cookie, 1P_JAR, NID, DV, NID
IDE, test_cookie
1P_JAR, NID, DV
NID
hblid
_reb2bgeo, _reb2bloaded, _reb2bref, _reb2bsessionID, _reb2buid

Security

These are essential site cookies, used by the google reCAPTCHA. These cookies use an unique identifier to verify if a visitor is human or a bot.

SID, APISID, HSID, NID, PREF
SID, APISID, HSID, NID, PREF