[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.

Tags:
  1. Gael

    Gael New Member

    Hello,
    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:
    Code:
    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:
    Code:
    /var/www/clients/client12/web19/web:/var/www/clients/client12/web19/web/ged:/var/www/clients/client12/web19/web/ged/tmp:/var/www/clients/client12/web19/private:/var/www/clients/client12/web19/tmp:/var/www/c12.app7.nc/web:/var/www/c12.app7.nc/web/ged:/var/www/c12.app7.nc/web/ged/temp:/srv/www/c12.app7.nc/web:/usr/share/php5:/usr/share/php:/tmp:/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin:/dev/random:/dev/urandom
    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