Instalando wordpress hostinger indonesia
There are a lot of wonderful guides out there on installing Laravel on a shared hosting service. However, every hosts have their own idiosyncrasies, and you are pretty much at the whim of the provider's server configuration. This one is Hostgator specific.
If you haven't already, enable SSH. Also, go to your control panel and go to Databases -> Remote MySQL-> and under Add Access Host, simply put a '%' in the empty field. Although this is not really related to installation, this is something you'll need to do in order to remotely access the Mysql database.
Connect to Hostgator's terminal using Putty or some other SSH tool. Once logged in, type 'pwd'. You should see something like this:
This is where we want to install Laravel. But in order to do so, we must install Composer. However, Composer requires PHP 5.3.2+ to run. To check the PHP version, type 'php -v' (remember, the terminal PHP can be different from the PHP configuration for your website). Hopefully you'll see someting like this:
PHP 5.5.6! You probably won't. In fact, you'll probably get PHP 5.2, just shy of the requirements to install composer and Laravel. In order to remedy this, create a new file called '.bashrc'. Kind of like .htaccess, the dot makes the file hidden. In the .bashrc file, put in the code:
Also, create a file called '.bash_profile'. In it, put:
We've created several aliases. The php alias allows us to simply type 'php' instead of the lengthy '/opt/php55/bin/php' in order to access PHP 5.5. The composer alias allows us to type 'composer' instead of 'composer.phar' before every command. Also, since, we've created a direct path to it, composer.phar can be accessed anywhere, even if the file is not in the Laravel directory. The export PATH line allows Laravel to correctly path to the right PHP during its installation. Aliases do not apply during the installation process. Lastly, the bash_profile file makes it so that the .bashrc file fires up every time you start the linux console.
Upload both of them in your CpanelUsername directory, so it looks something like this:
Your directory may have more files and folders, and I've purposefully ommited the hidden ones. Now, you must activate the bash files. In your console, type: 'source
/.bashrc' and then check your php version by typing 'php -v'.
Awesome! We're good to go. Oh, while we're on the topic of PHP 5.5, we want to make an '.htaccess' file in our public_html folder. Create a file called '.htaccess' and write:
This will enable PHP 5.5.6 on the website. Eventually, after we integrate Laravel's .htaccess, it should look something like this:
Time to install Composer. In your terminal, type:
The above process will download the necessary composer files in the current location. After that, install Laravel by running the following command:
Now your directory should look something like this:
If you open the laravel folder, you'll see a folder structure like this:
You want to take the contents from the public folder and move them to the public_html folder. You can delete the public folder. It should look like this:
At this point, this starts to look a lot like Dries Vint's excellent guide. We are doing the first option. Anyway, open the 'laravel/bootstrap/paths.php' file and correct the bootstrap path like this:
Do the same in 'public_html/index.php' and change the following lines:
And that is it! Fire up your website and enjoy the lovely 'hello' screen :).