# Problems with Apache and PHP

## newhouse

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

----------

## newhouse

```
<?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

----------

## ptitman

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

----------

## newhouse

Thanks ptitman

----------

## ptitman

btw, dont forget to /etc/init.d/apache reload   :Wink: 

----------

## newhouse

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,,,

----------

