As of Laravel 5.3 the 1and1 hosting does NOT meet all Laravel requirements
Laravel 5.3 requires php command line version to be
PHP >= 5.6.4.
DO NOT USE 1AND1 HOSTING SERVICE IF YOU WANT TO DEPLOY A LARAVEL APP >= 5.3
This guide will work nicely if you have a Laravel webapp version 5.2 or 5.1 working already like a charm.
Your webapp uses Laravel version 5.2 or 5.1.
Your webapp is under version control so you can clone your repo in a remote server. 1and1 supports Git by default.
You have ssh access to the deployment server.
You have a Laravel webapp version 5.2 or 5.1 setup and working.
Configure PHP version to 7 on 1and1 control panel, just Google for how to change 1and1 PHP version.
MAKE SURE THE DEPLOYMENT DOMAIN IS RUNNING PHP VERSION >= 5.5.9.
PHP command line version
1and1 php command line version is 4.x, this means our commands won’t work
when we deploy, nevertheless, a php 5.5 command line version is
installed on 1and1, to try it run
php5.5 -v in your ssh session.
The name of the php version 5.5 may differ like: php5.5-cli
To have same command available in our development machine we can run:
ln -s /usr/local/bin/php /usr/local/bin/php5.5
This way on 1and1 we can run.
php5.5 artisan down
To put our site into maintenance mode and so on.
Getting the sources
Clone your repo in the remote server using ssh and place yourself on the root directory of your webapp.
artisan file with your text editor and replace the first line,
change it to
The path corresponds to the 1and1 php5.5 path. You can see it by
Check the path is working fine since it may differ.
Edit the file
composer.json replace the php scripts references to
1 2 3
1 2 3
curl -sS https://getcomposer.org/installer | php5.5 You’ll notice
the new file
php5.5 composer.phar install
php5.5 artisan clear-compiled.
php5.5 artisan optimize.
cp .env.example .env.
php5.5 artisan key:generate
.env file with the corresponding values. Check the Laravel
site documentation for more information.
I think you should know that for shared hostings plans on 1and1 you won’t be able to use
SMTP(in some cases this will work, but in most cases you won’t be able to send mail through
SMTP) instead use the PHP’s
MAKE SURE YOUR DOMAIN HAS ITS ROOT IN THE PUBLIC FOLDER
Replace default setup on your
.htaccess file under your
folder with the following.
1 2 3 4 5 6 7 8
Navigate to your url and check results.