Search code examples
php.htaccesscodeigniternetwork-programmingserver

Install codeigniter in parallels plesk server


The server runs 5.4.3 PHP with FastCGI

For Cpanel, it works perfectly, however, it fail in plesk server.

Here is the .htaccess used:

RewriteEngine on
DirectoryIndex index.php
RewriteCond $1 !^(index\.php|assets|upload|robots\.txt)
RewriteRule ^(.*)$ /my_folder/index.php/$1 [L] 

In config file:

$config['base_url'] = '';
$config['index_page'] = '';

When I enter the home page, it shows:

Welcome to Parallels!

If you are seeing this message, the website for kotechweb.com is not available at this time.
If you are the owner of this website, one of the following things may be occurring:

You have not put any content on your website.
Your provider has suspended this page.

If I don't use .htaccess, then it is a codeigniter 404 not found page. And it can go (although with a lot of error)

mydomin.com/my_folder/index.php/welcome/ 

eg.

Message: is_dir(): open_basedir restriction in effect. File(/var/lib/php/session) is not within the allowed path(s): (/var/www/vhosts/my_domain.com/:/tmp/)

Filename: drivers/Session_files_driver.php

Line Number: 115

And a lot mkdir , session error...

also can not go other controller, it show 404 codeigniter not found page

Any way to debug and fix it? Thanks


Solution

  • I have figure out how to fix it at last.

    First , make sure the controller class file name is in Capital letter. Lower case file name works in Apache but not the fastcgi.

    Second, change the htaccess to :

    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php/$1 [L]