Welcome Guest, Not a member yet? Register   Sign In
Step 2 (99.9% newb)
#1

[eluser]McHenry[/eluser]
I have codeigniter installed and and setup to edit the next files as I follow the training video... easy.

I am developing on a local Linux webserver (CentOS) 192.168.2.2

When I point my browser to 192.168.2.2 I am presented with the CentOS welcome page, as expected.

When I point me browser to 192.168.2.2/codeigniter I am presented with a totally blank page.

Every time I try to load the page the following two entries appear in my log file:

[Tue Oct 27 09:34:28 2009] [error] [client 192.168.1.98] PHP Warning: require(/var/www/html/CodeIgniter_1.7.2/system/application/config/config.php) [<a href='function.require'>function.require</a>]: failed to open stream: Permission denied in /var/www/html/CodeIgniter_1.7.2/system/codeigniter/Common.php on line 186

[Tue Oct 27 09:34:28 2009] [error] [client 192.168.1.98] PHP Fatal error: require() [<a href='function.require'>function.require</a>]: Failed opening required '/var/www/html/CodeIgniter_1.7.2/system/application/config/config.php' (include_path='.:/usr/share/pear:/usr/share/php') in /var/www/html/CodeIgniter_1.7.2/system/codeigniter/Common.php on line 186

I have rechecked the base_dir I set as part of the installation process and it reads:
$config['base_url'] = "http://localhost/codeignite/";

I have also tried:
$config['base_url'] = "http://192.168.2.2/codeignite/";

Finally I have read here and tried:
$config['base_url'] = "http://".$_SERVER['HTTP_HOST']."/codeigniter/";

None of which resolve the problem...
#2

[eluser]rogierb[/eluser]
Your error says Permission denied...

So you got a problem with rights in your folder /var/www/html/CodeIgniter_1.7.2.

Chown it to the apache user.
#3

[eluser]McHenry[/eluser]
I've checked the file permissions and it's all as per default.

root@latenights /]# ls -l /var/www
total 48
drwxr-xr-x 2 root root 4096 Jan 22 2009 cgi-bin
drwxr-xr-x 3 root root 4096 Oct 20 21:54 error
drwxr-xr-x 3 root root 4096 Oct 27 07:36 html
drwxr-xr-x 3 root root 4096 Oct 25 01:33 icons
drwxr-xr-x 14 root root 4096 Oct 20 21:55 manual
drwxr-xr-x 2 webalizer root 4096 Oct 25 02:46 usage
[root@latenights /]# ls -l /var/www/html
total 2196
lrwxrwxrwx 1 root root 17 Oct 27 04:23 codeigniter -> CodeIgniter_1.7.2
drwxr-xr-x 4 root root 4096 Oct 27 08:30 CodeIgniter_1.7.2
-rw-r--r-- 1 root root 2227891 Sep 12 00:51 CodeIgniter_1.7.2.zip
[root@latenights /]#


The error refers to line 186 in Common.php which contains the following:
require(APPPATH.'config/config'.EXT);
#4

[eluser]jedd[/eluser]
[quote author="McHenry" date="1256577042"]
[root@latenights /]# ls -l /var/www/html
lrwxrwxrwx 1 root root 17 Oct 27 04:23 codeigniter -> CodeIgniter_1.7.2
drwxr-xr-x 4 root root 4096 Oct 27 08:30 CodeIgniter_1.7.2
[/quote]


Symlinks can add unwanted confusion - I'd remove this one. Try this, and paste the output you get:

Code:
#  cd /var/www/html
#  rm codeigniter
#  mv CodeIgniter_1.7.2 codeigniter
#  ls -l codeigniter

Any permissions problems you're having are likely contained within the ci structure proper, not at the top level here.

If you are feeling game you could also
Code:
#  cd /var/www/html
#  chmod -R 775 codeigniter

This is pretty ugly as it sets all files to be executable too, but it'll instantly prove out if you have a permissions problem.

Does CentOS have an apache user btw?
#5

[eluser]rogierb[/eluser]
Centos uses 'apache' as the default apache user.

So you have to chown the CodeIgniter_1.7.2 folder to apache:apache.
#6

[eluser]McHenry[/eluser]
For practice I simply deleted the codeigniter folder and then reunzipped it again and now it works... NO IDEA !

Permissions are the same, apache user remains unchanged at root and all I have not done this time is edit the base_dir in config.php... why fix what's not broken !

Thanks for all the help... after midnight now so I'll start again tomorrow, but very interesting I must say.
#7

[eluser]Pr0v4[/eluser]
I don't understand I've followed the same steps but i'm not been so lucky...

I mean, on my host i've uploaded the directory of codeigniter and renamed in "ci", when I try to see the welcome page google give to me a 404 error (you can check at this page), but if instead i try to see the licence.txt file i don't have any problems!!! Check out at this link.

Sincerely i don't have a clue for solve this problem.

I've just tried:
- http://www.andreabarghigiani.info/exercise/ci/
- http://localhost/exercise/ci/
- http://127.0.0.1/exercise/ci/
Obviously the declaration of each one it' been as follow:
Code:
$config['base_url']    = "http://127.0.0.1/exercise/ci/";
in the file config.php present in the directory /system/application/config/

I wanna repeat that this error is present only in my web hosting in fact in my local web server I don't have any problem to run thi framework! BTW I would like use it online Big Grin

Thanks for the potential help!

Latest news
:
Sometimes doesn't let me see the page licence.txt, that's strange!




Theme © iAndrew 2016 - Forum software by © MyBB