CodeIgniter Session Error – Operation not Permitted

On some hostings you can receive this error.

A PHP Error was encountered

Severity: Warning

Message: unlink(/tmp/ci_session0189a7f1c86eb18fb70afcfedc2d5040e9c23146): Operation not permitted

Filename: drivers/Session_files_driver.php

To fix this go to application > config > config.php and edit this line:

$config['sess_save_path'] =  BASEPATH . 'cache/';

Laravel first steps

Hello, this article is for beginners and will show basic functions.

Installation of Laravel

To begin with instalation we need composer. In console write the following.

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

What is artisan

Artisan is the name of the command-line interface included with Laravel. It provides a number of helpful commands for your use while developing your application. It is driven by the powerful Symfony Console component.

Continue reading “Laravel first steps” »

Laravel on shared hosting

I will show you not the fastest but easiest way to move Laravel project to shared hosting. You need to be sure that you are using PHP version >= 5.6.4.

First step

First connect to your FTP and create folder outside “public_html”. You can use any name but in this example I will use (“Laravel”) for the name of this folder.

Move everything except “public” folder from your Laravel project to your newly created folder on shared hosting. It will take some time!

In “public_html” folder you need to move files from “public” folder in your Laravel project.

Open index.php file and change the paths to autoload.php and app.php files. They should point to files in the Laravel folder.
Continue reading “Laravel on shared hosting” »

Create virtual host on WAMP 3

Project Links do not work on Wamp Server!!!

In WampServer it is now recommended to create a Virtual Host for each of your projects, even if you hold them in a \wamp\www\subfolder structure. The WampServer home page ( \wamp\www\index.php ) now expects you to have created a Virtual Host for all your projects and will therefore work properly only if you do so.

How to create a Virtual Host in WampServer

There are 3 steps to create your first Virtual Host in Apache, and only 2 if you already have one defined.
Continue reading “Create virtual host on WAMP 3” »

Codeigniter 3 – Fast setup

Download and extract codeigniter. In main folder create another folder named assets. There will be additional files for css, js and more.

Setup configuration files. Go to application/config:
– in autoload.php

$autoload['libraries'] = array('database','session');
$autoload['helper'] = array('url','form');

– in config.php

$config['base_url'] = '';
$config['index_page'] = '';
$config['encryption_key'] = 'someEncryptionKey';
$config['sess_save_path'] = sys_get_temp_dir(); //Fix problems with session

– in database.php

'username' => 'root',
'password' => 'rootPassword',
'database' => 'DatabaseName',

– in routes.php

$route['default_controller'] = 'Main_controller';

Step 2 Create Main_controller file in application/controllers
Easiest way is to copy and rename Welcome.php

Step 3 Create .htaccess file in main folder. This is a must for routing!

RewriteEngine On

RewriteCond %{HTTP_HOST} ^ [NC]
RewriteRule ^(.*)$$1 [L,R=301]

RewriteCond %{THE_REQUEST} ^[A-Z]+\ /index\.php(/[^\ ]*)?\ HTTP/
RewriteRule ^index\.php(/(.*))?$$2 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]