Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Problems with Apache and PHP
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
newhouse
n00b
n00b


Joined: 01 Feb 2004
Posts: 13

PostPosted: Tue Feb 03, 2004 11:14 am    Post subject: Problems with Apache and PHP Reply with quote

Hi!!, I'm trying to do my first steps in php but I've had my first problems.

When I try to view my webpage apache shows me that:

Warning: fopen(): URL file-access is disabled in the server configuration in /var/www/localhost/htdocs/index.php on line 10

Somebody know how I can do??

Regards.

SORRY FOR THE DUPLICATE MESSAGE
_________________
In the sky
together
To the night
Forever
Back to top
View user's profile Send private message
newhouse
n00b
n00b


Joined: 01 Feb 2004
Posts: 13

PostPosted: Tue Feb 03, 2004 11:18 am    Post subject: Reply with quote

Code:
<?php
        $mercado='PRISA';
        $url='http://www.invertia.com/empresas/empresa.asp?idtel=RV011PRISA';

        if (!($descriptor = fopen($url, 'r')))
        {
          echo 'Error al obrir la pagina';
          exit;
        }
        $contingut = fread($descriptor);
        fclose($descriptor);


This is the code where there is the problem.

Regards
_________________
In the sky
together
To the night
Forever
Back to top
View user's profile Send private message
ptitman
Apprentice
Apprentice


Joined: 12 Sep 2003
Posts: 242
Location: well!! I don't really know!Anywhere really!

PostPosted: Tue Feb 03, 2004 12:00 pm    Post subject: Reply with quote

here you got the answer :wink: from php.net.

you need to edit /etc/apache2/conf/php.ini and set allow_url_fopen = On instead of the default allow_url_fopen = Off.

enjoy
_________________
Feeds2Read.net
Gentoo Linux News
Gentoo Linux Security Advisories
Back to top
View user's profile Send private message
newhouse
n00b
n00b


Joined: 01 Feb 2004
Posts: 13

PostPosted: Tue Feb 03, 2004 12:03 pm    Post subject: Reply with quote

Thanks ptitman
_________________
In the sky
together
To the night
Forever
Back to top
View user's profile Send private message
ptitman
Apprentice
Apprentice


Joined: 12 Sep 2003
Posts: 242
Location: well!! I don't really know!Anywhere really!

PostPosted: Tue Feb 03, 2004 12:04 pm    Post subject: Reply with quote

btw, dont forget to /etc/init.d/apache reload :wink:
_________________
Feeds2Read.net
Gentoo Linux News
Gentoo Linux Security Advisories
Back to top
View user's profile Send private message
newhouse
n00b
n00b


Joined: 01 Feb 2004
Posts: 13

PostPosted: Tue Feb 03, 2004 6:19 pm    Post subject: Reply with quote

Thanks a lot, but now I have another problem:

When I view my index.php file apache shows me the following...

failed to open stream: HTTP request failed! HTTP/1.1 500 Internal Server Error in .....

I don't know why, because this error is from my server..

Thanks,,,
_________________
In the sky
together
To the night
Forever
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum