10

i read an article regarding google rank and i wanted to create a php script that get the page rank using curl in php - i endded up using this script:

http://www.brightyoursite.com/blog/2010/06/01/use-php-to-get-google-page-rank/

now when i run it i get on my ubuntu:

Fatal error: Call to undefined function curl_init() in /var/www/googlerank.php ....

Adéline
  • 235
  • 1
  • 6

1 Answers1

13

You have to install php5-curl.

On Ubuntu or Debian, you can do this by running either apt-get install php5-curl or aptitude install php5-curl depending on which command you use to manage your packages.

You can see whether it is currently installed or not using the command aptitude show php5-curl.

It is always good to keep a PHP script with only this code:

<?php phpinfo() ?>

The above code will print a lot of information about server, the request, installed packages, etc. that are useful for diagnosing issues. If php5-curl is installed, you should find a section for 'curl' in the output here.

Susam Pal
  • 32,765
  • 12
  • 81
  • 103