I recently set up a development server in a VirtualBox VM running Ubuntu server 11.04. My plan was to move a development database and website to this VM and migrate away from a local XAMPP installation on a Windows box. The only problem is that Apache and PHP were not exactly the same between the two systems. This resulted in some of my scripts not working correctly. More specifically, I was getting the “PHP Fatal error: Call to undefined function curl_init()” error. On my Ubuntu VM.
This likely meant that curl was not installed or enabled on Ubuntu, so here’s what I did:
- Run this command from a terminal:
- sudo apt-get install curl libcurl3 libcurl3-dev php5-curl
- In the section for dynamic extensions add (or uncomment):
- sudo /etc/init.d/apache2 restart