Need user notification after installing php-mysql

Bug #104270 reported by Christian Convey
2
Affects Status Importance Assigned to Milestone
php5 (Ubuntu)
Confirmed
Wishlist
Unassigned

Bug Description

I installed the package "php-mysql". When I re-loaded my .php page, I was still getting errors that the class "mysqli" couldn't be found.

It turns out that I needed to restart (or maybe just sighup) apache2 in order for the mysql-related classes to be accessible to my php pages. This is contrary to most other ubuntu packages, where installing the package makes its functionality immediately available *OR* the user gets alerted that a reboot, etc. is needed.

The bug I'm reporting is that when we install the php-mysql package, we should get that little balloon message (like we get when we update a firefox package and it tells us that we need to restart firefox) telling us that we need to restart apache2 for the functionality to become available.

This is similar to this bug:
https://bugs.launchpad.net/ubuntu/+source/php5/+bug/63045
but different.

Soren Hansen (soren)
Changed in php5:
importance: Undecided → Wishlist
status: New → Confirmed
Revision history for this message
Ondřej Surý (ondrej) wrote :

Same for libapache2-mod-php5 itself (#152410).

Revision history for this message
Soren Hansen (soren) wrote : Re: [Bug 104270] Re: Need user notification after installing php-mysql

On Wed, Oct 17, 2007 at 12:50:16PM -0000, Ondřej Surý wrote:
> Same for libapache2-mod-php5 itself (#152410).

No, libapache2-mod-php5 already does that. Snippet from its postinst:

reload_apache()
{
 if apache2ctl configtest 2>/dev/null; then
  invoke-rc.d apache2 force-reload || true
 else
  echo "Your apache2 configuration is broken, so we're not restarting it for you."
 fi
}

if [ -n "$2" ]; then
# we're upgrading. test if we're enabled, and if so, restart to reload the module.
 if [ -e /etc/apache2/mods-enabled/php5.load ]; then
  reload_apache
 fi
        exit 0
fi

--
Soren Hansen
Ubuntu Server Team
http://www.ubuntu.com/

Revision history for this message
Soren Hansen (soren) wrote :

Just to note: It's not just a matter of restarting apache2. People might
a) be using a different webserver which needs to get restarted => restart the other webserver,
b) be using a different webserver which doesn't need to get restarted => Don't do anything,
c) be using php5 for scripting purposes and might just happen to have an apache server running doing other things. => don't do anything,
d) be using apache, but php5 as a cgi interpreter => don't do anything,
e) or something entirely different that I forgot to take into account.

The best we can do (off the top of my head) is to notify the user of the possible need to restart. The postinst should do this and a mail should be sent to root (the common way to notify users about these things on servers).

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.