Codeigniter nginx configuration in PHP 7.1 on Ubuntu server

I assume you have already nginx on your computer or server. And this is the configuration for your codeigniter application. This is the nginx configuration for your application.

server {
listen 8890;
server_name localhost;
root /usr/share/nginx/html/simpad;
autoindex on;
index index.php;

error_log /var/log/nginx/simpad-error.log;

location / {

try_files $uri $uri/ /index.php;

location = /index.php {

fastcgi_pass unix:/var/run/php/php7.1-fpm.sock;
fastcgi_param SCRIPT_FILENAME /usr/share/nginx/html/ci$fastcgi_script_name;
include fastcgi_params;
fastcgi_buffers 256 16k;
fastcgi_buffer_size 128k;
fastcgi_busy_buffers_size 256k;
fastcgi_temp_file_write_size 256k;
}
}

location ~ \.php$ {
return 444;
}
}

And then Restart your nginx : /etc/init.d/nginx restart.

Open your Codeigniter application configuration file on : application/config/config.php for update some configuration.

Change this configuration like this code :

$config[‘base_url’] = “”;

$config[‘index_page’] = “”;

And then run your codeigniter application on your browser.

if you have an error like this : Only variables should be assigned by reference on Loader.php on your codeigniter core you must open file on system/core/Common.php and change like this code :

function &is_loaded($class = ”)

If you have a question about the configuration please leave your comment.

Thank you

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s