Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

For security reasons i'm running fastcgi php as non-privileged user "user", but looks like running php as different users provide different abilities,

I have strange issue with php setup:

root@devz:~# su -c "php5 /www/root.php" user
PHP Warning:  file_get_contents(): SSL: Success in /www/root.php on line 3
PHP Warning:  file_get_contents(): Failed to enable crypto in /www/root.php on line 3
PHP Warning:  file_get_contents(https://twitter.com/): failed to open stream: operation failed in /www/root.php on line 3

and

root@devz:~# su -c "php5 /www/root.php" root
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de">
<head>....

root.php

<?php print file_get_contents("https://twitter.com/"); ?>

system: debian 6.0 64 bit with all needed updates, php:

root@devz:~# php -v

PHP 5.3.6-8 with Suhosin-Patch (cli) (built: Apr 10 2011 22:41:22)
Copyright (c) 1997-2011 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies with Suhosin v0.9.32.1, Copyright (c) 2007-2010, by SektionEins GmbH

Maybe someone had same issues? If yes, give a note here. Thanks!

share|improve this question

1 Answer 1

If you are using Suhosin then take a look at this documentation. Suhosin explicit blocks getting URLs, files and includes from places that are not on its configutation.

On Debian, Suhosin logging comes turned off by default, so look at /etc/php5/conf.d/suhosin.ini and enable the syslog logging option to check if its really Suhosin that is blocking your request. If that's the problem, add the URLs you want to access to Suhosin whitelist on this same file and your php should run correctly.

share|improve this answer
    
i added suhosin.simulation = on and suhosin.log.syslog =S_ALL, and i dont get specific erros from suhosin, or i'm missed something? also tried suhosin.executor.include.whitelist = http, https but i'm not sure that this is correct :( –  excanoe Apr 17 '11 at 17:42
    
maybe it's not a suhosin problem then. –  coredump Apr 17 '11 at 17:45
    
it's very strange but with ubuntu (php 5.3.2 with suhosin) all is working fine. and truly speaking this is very odd. i tried fresh debian install and ubuntu. –  excanoe Apr 17 '11 at 18:26

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.