php5-curl install should restart apache not reload it

Bug #762054 reported by ironstorm
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
php5 (Ubuntu)
Fix Released
Undecided
Unassigned
Maverick
Won't Fix
Low
Unassigned

Bug Description

Binary package hint: php5

Installing php5-curl, the post-install script does an Apache2 "reload" which refreshes the configuration, but does not cause the new libs to be loaded into memory. The result is any PHP page using curl will crash until Apache2 is "restarted".

Install:

aptitude install php5-curl
The following NEW packages will be installed:
  php5-curl
0 packages upgraded, 1 newly installed, 0 to remove and 69 not upgraded.
Need to get 26.9kB of archives. After unpacking 127kB will be used.
Get:1 http://archive.ubuntu.com/ubuntu/ maverick-updates/main php5-curl amd64 5.3.3-1ubuntu9.3 [26.9kB]
Fetched 26.9kB in 0s (48.3kB/s)
Selecting previously deselected package php5-curl.
(Reading database ... 566689 files and directories currently installed.)
Unpacking php5-curl (from .../php5-curl_5.3.3-1ubuntu9.3_amd64.deb) ...
Processing triggers for libapache2-mod-php5 ...
 * Reloading web server config apache2
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
   ...done.
Setting up php5-curl (5.3.3-1ubuntu9.3) ...

Error Received:
[Fri Apr 15 14:08:40 2011] [error] [client 67.70.64.123] PHP Fatal error: Call to undefined function curl_init() in /opt/mozbx/class_zabbix.php on line 592

Workaround:
sudo /etc/init.d/apache2 restart
 * Restarting web server apache2

The problem is then resolved.

Revision history for this message
Clint Byrum (clint-fewbar) wrote :

Hi ironstorm, thanks for taking the time to file this bug report and help us make Ubuntu better!

I've just done some tests with this, and I cannot confirm the issue on natty..

I created a PHP file in the webroot of apache:

<?php

$ch = curl_init();

Then hit it without curl installed.. and I got a 500 error as I would expect.

I then installed php5-curl, and refreshed the page. As soon as the libapache2-mod-php5 trigger reloaded apache, the page started returning a 200.

This is in apache's error log:
[Sat Apr 16 08:23:00 2011] [error] [client 127.0.0.1] PHP Fatal error: Call to undefined function curl_init() in /var/www/curl.php on line 3
[Sat Apr 16 08:23:00 2011] [notice] Graceful restart requested, doing restart
[Sat Apr 16 08:23:01 2011] [notice] Apache/2.2.17 (Ubuntu) PHP/5.3.5-1ubuntu6 with Suhosin-Patch mod_wsgi/3.3 Python/2.7.1+ configured -- resuming normal operations

It does seem to happen on maverick, but I can't seem to find the exact changelog item that has made this a reality.

As such, I'm going to mark this as Fix Released, and open a task against Maverick that is Confirmed, importance Low.

Changed in php5 (Ubuntu):
status: New → Fix Released
Changed in php5 (Ubuntu Maverick):
status: New → Confirmed
importance: Undecided → Low
Revision history for this message
ironstorm (ironstorm-gmail) wrote :

Thanks Clint, I'm glad to hear it's already fixed for the next release. :D

Revision history for this message
Rolf Leggewie (r0lf) wrote :

maverick has seen the end of its life and is no longer receiving any updates. Marking the maverick task for this ticket as "Won't Fix".

Changed in php5 (Ubuntu Maverick):
status: Confirmed → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.