0

I`m running a cron job daily to check if an invoice has to be created (using dompdf). The PDF should get created and saved in a folder.

So far the cron_script.php gets executed and all Database entries and email sendings get done. The problem is the dompdf library.

PHP Warning:  realpath(): SAFE MODE Restriction in effect.  The script whose uid is 10000 is not allowed to access /var/www/vhosts/domain.com owned by uid 0 in /var/www/vhosts/domain.com/dompdf/include/functions.inc.php on line 135

PHP Warning:  file_put_contents(): SAFE MODE Restriction in effect.  The script whose uid is 10000 is not allowed to access /var/www/vhosts/domain.com/files owned by uid 33 in /var/www/vhosts/domain.com/cron_script.php on line 162

PHP Warning:  file_put_contents(/var/www/vhosts/domain.com/files/invoice_2145.pdf): failed to open stream: No such file or directory in /var/www/vhosts/domain.com/cron_script.php  on line 162

It must have something to with permission. But Safe_Mode is completly Off (Master and Slave). Thanks for help Toni

Toni_Nutone
  • 105
  • 1
  • 9
  • Some configurations use a different php.ini for CLI and that could be the reason safe_mode is enabled (i.e. it's enabled in the CLI php.ini). Easiest way to check is to log what's returned by `ini_get("safe_mode");`. If you're still not sure, [check this answer](http://stackoverflow.com/a/2750582/264628) (plus the comments) for info on how to determine what php.ini was used. – BrianS Feb 07 '14 at 16:29
  • I get safe_mode = 0 , hm? Its turned off. – Toni_Nutone Feb 09 '14 at 16:48
  • Are you on shared hosting? Did you check from a cron job or run interactively? Just tossing some thoughts out there since PHP is saying safe mode is on in the errors but not when you check the setting. – BrianS Feb 10 '14 at 16:37

0 Answers0