Question

Quick question.

Why do I get the following error and how can I solve it?

require_once() [function.require-once]: open_basedir restriction in effect.
File(/lib/swift_required.php) is not within the allowed path(s):
(/home/thnk/:/tmp:/var/tmp:/usr/local/lib/php/)

Thanks!

Was it helpful?

Solution

Problem solved. The issue was happening because I was using a wrong path for the library.

I was trying to call the library from:

/lib/swift_required.php

And it should be located somewhere like here:

$basePath = '/home/mydomain/domains/mydomain.org/public_html/myapp/';
require_once($basePath . 'system/vendor/swift/Swift/lib/swift_required.php');
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top