[resolved] fopen(): open_basedir restriction in effect. File(/dev/null) is not within the allowed

Discussion in 'Installation/Configuration' started by Gael, Jul 13, 2020.

  1. Gael

    Gael New Member

    I have an isconfig 3.1.12 installation

    I browsed the forum and found the same problem several times but the solutions that have been tried do not work :(

    I work with the Laravel framework to avoid giving access from the web to uploaded files, I store them in a directory outside the public
    On my local server and dev everything works fine
    On the production server which works with ispconfig I have this error message
    fopen (): open_basedir restriction in effect. File (/ dev / null) is not within the allowed path (s)

    At the vhost level I have some modifications, not all of them correspond to my problem:
    DocumentRoot "/var/www/clients/client12/web19/web/public"
    Header always set Strict-Transport-Security "max-age = 31536000; includeSubDomains"
    Header always append X-Frame-Options SAMEORIGIN
    Header edit Set-Cookie ^ (. *) $ $ 1; HttpOnly; Secure
    Header set X-XSS-Protection "1; mode = block"
    Header set X-Content-Type-Options nosniff
    you can see I'm pointing the web directory to public
    my tree
    web /
    framework directories
    public / (the public directory)
    ged / (the file storage directory)
    ged / tmp / (a temporary directory which I use to create large pdf)​

    for the storage part no problem I can upload pdf, word, Excel from a form ... and I can also call them and display / download them.

    My problem is in the generation of pdf I need to generate large pdf (700 to 800 pages) for that I chose a multi process approach. I create several php processes which each generate a part of the final pdf for me each pdf is stored in the directory tmp / {user_id} / {ask_id}
    once all the chapters are created i merge them into a single file which is stored directly in ged. the directories and file in tmp are then deleted.

    I modified open_basedir PHP:
    but nothing to do that does not give me access to this damn directory rights to the directory have been verified and having tried everything I even restart the server completely (without much conviction ...)

    Thanks for your help
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    The error message said that access to /dev/null is not allowed and as far as I can see, you did not add /dev/null to the allowed paths in open basedir yet.
  3. Gael

    Gael New Member

    Dear Till,
    I do not thank you, I am never felt alone until after reading your answer ;)
    I misinterpreted my logs. I thought the information was generic and I did not add the /dev/null o_O
    Thank you so much

    It is done with /dev/null my script can generate my pdf.
    I hope my stupidity will help someone else

    PS : sorry for my average english

Share This Page