• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion
  • Inviting everyone to the UX test of a new security feature in the WP Toolkit
    For WordPress site owners, threats posed by hackers are ever-present. Because of this, we are developing a new security feature for the WP Toolkit. If the topic of WordPress website security is relevant to you, we would be grateful if you could share your experience and help us test the usability of this feature. We invite you to join us for a 1-hour online session via Google Meet. Select a convenient meeting time with our friendly UX staff here.

Resolved file_exists(): open_basedir restriction in effect - Obsidian with PHP 8.1

Klaazzzzzz

New Pleskian
I uploaded my first Statamic 3.3 website (Based om Laravel 8) in new subscription on my Ubuntu server with Obsidian. This Laravel version needs PHP >8.02 so I updated Obsidian with PHP 8.1 and selected this PHP version in the subscription.

AH01071: Got error 'PHP message: PHP Fatal error: Uncaught ErrorException: file_exists(): open_basedir restriction in effect. File(/var/www/project/resources/views/errors/500.blade.php) is not within the allowed path(s): (/var/www/vhosts/project.com/:/tmp/) in /var/www/vhosts/project.com/httpdocs/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php:28

  • Statamic uses Antlers templates, not Blade. I never used Blad in the fresh project
  • Statamic is a flat file CMS, there is no database, all files are uploade exactlyd like they are on the development server (Where it works flawlessly)
  • The filepath misses 'vhosts/project.com/httpdocs', IMHO necessary because the file paths does not exists. I don't know why it makes this up because I did not configure this

I just uploaded files & directories, just like I do on other projects. I also set the right permissions on the storage and bootstrap/cache directory. I don't understand why this is not working.
 
User Afonic in Statamic site in Plesk Obsidian (open_basedir restriction in effect) · Discussion #5543 · statamic/cms gave the right suggestion so could solve the issue.

I did not have to delete the vendor folder, just composer dump-autoload was enough.

One thing I had to change for that to work was the CLI PHP version. In Plesk you can install and select multiple PHP versions so every project can have it's own specific PHP version. But even if you choose PHP 8.1 in the project in Plesk's interface, the terminal PHP CLI version will not change. In my case this was defaulted to PHP 7.4 which was not recent enough of course.

But you can change that in the terminal: export PATH=/opt/plesk/php/8.1/bin:$PATH; This is temporary, after logging out it will be the old default again again.
 
Hello Mow and Klaazzzzzz,

I have something similar issue when I check the Logs for my website. I have a PHP script with Laravel, the site opens fine, and I don’t want to have any issues in the future or now, which I might not notice yet since I am new to Plesk.

Here is the error message I get:

AH01071: Got error 'PHP message: PHP Warning: file_exists(): open_basedir restriction in effect. File(/autoload.php) is not within the allowed path(s): (/var/www/vhosts/MySite.com/:/tmp/) in /var/www/vhosts/MySite.com/httpdocs/vendor/vonage/nexmo-bridge/src/Autoloader.php on line 69', referer: https://MySite.com

I would appreciate any help and walking me through to get this fixed.
Thank you.
 
Back
Top