-2

I have a CodeIgniter Application for Administration purposes, put in a Subdirectory of the domain.

I get the following error when I update a record and try to clear the cached copy of the page, which resides in the Cache folder in domain root.

My server have Plesk control panel and I have tried modifying the vhost.conf and restarted the server but the problem still stays...

First of all I cannot understand why a php script in a subdirectory cannot access a folder in the root, is this because of CodeIgniter?

Please help... Following is the Error I receive.

A PHP Error was encountered

Severity: Warning

Message: unlink(): open_basedir restriction in effect. File(../../cache/2dd676d5e044a6190d27ccbaf094db7b.html) is not within the allowed path(s): (/var/www/vhosts/xyz.com/httpdocs/:/tmp/)

Filename: models/products_model.php

Line Number: 180
  • Did you search for the error message and try to solve it? – ilanco May 18 '12 at 21:31
  • Yes doing it for 4 5 hours... Tried so many things. At first the CI app was in a subdomain and I thought it might work if I put it into a subdirectory, but the error is still there. any ideas? – Junaid Ali May 18 '12 at 21:33

1 Answers1

0

do you actually have 'open_basedir' allowed on your server? It can often be turned off - and would generate this sort of error...

Laurence
  • 58,936
  • 21
  • 171
  • 212
  • The same routine is working absolutely fine in another PHP script. – Junaid Ali May 18 '12 at 21:50
  • does that routine access the same file/directory? – Laurence May 18 '12 at 21:55
  • It's like whenever user make some changes the script removes the static html cached copy so the changes are registered, and it works. Now I have made this administration app and it's in the subdirectory of the same domain, and when I edit a record and tries to the remove the cached file, this error appears. I am confused how php disallow a script in the same subdirectory. Does this have anything to do with CodeIgniter? – Junaid Ali May 18 '12 at 22:00
  • no - it is not a codeigniter problem. it seems like a problem with opendir() and the access privilages in the subdomain (or perhaps the path to the subdomain) - which is why it is not working – Laurence May 18 '12 at 22:08
  • The CodeIgniter App is in the SubDirectory, not the Subdomain. – Junaid Ali May 19 '12 at 00:10