Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Running debian 4.0
Trying to

$ apt-get install php5

I get

Reading package lists... Done
Building dependency tree... Done
php5 is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.
4 not fully installed or removed.
Need to get 0B of archives.
After unpacking 0B of additional disk space will be used.
Setting up apache2.2-common (2.2.3-4+etch11) ...
chown: `www-data': invalid user
dpkg: error processing apache2.2-common (--configure):
 subprocess post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of apache2-mpm-prefork:
 apache2-mpm-prefork depends on apache2.2-common (= 2.2.3-4+etch11); however:
  Package apache2.2-common is not configured yet.
dpkg: error processing apache2-mpm-prefork (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of libapache2-mod-php5:
 libapache2-mod-php5 depends on apache2-mpm-prefork (>> 2.0.52) | apache2-mpm-itk; however:
  Package apache2-mpm-prefork is not configured yet.
  Package apache2-mpm-itk is not installed.
 libapache2-mod-php5 depends on apache2.2-common; however:
  Package apache2.2-common is not configured yet.
dpkg: error processing libapache2-mod-php5 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of php5:
 php5 depends on libapache2-mod-php5 (>= 5.2.0+dfsg-8+etch16) | libapache-mod-php5 (>= 5.2.0+dfsg-8+etch16) | php5-cgi (>= 5.2.0+dfsg-8+etch16); however:
  Package libapache2-mod-php5 is not configured yet.
  Package libapache-mod-php5 is not installed.
  Package php5-cgi is not installed.
dpkg: error processing php5 (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 apache2.2-common
 apache2-mpm-prefork
 libapache2-mod-php5
 php5
E: Sub-process /usr/bin/dpkg returned an error code (1)

What could be the problem ?

share|improve this question
    
I'd assume setting LANGUAGE and LC_ALL would be a good start. –  Oliver Salzburg May 31 '12 at 12:21
    
LANGUAGE and LC_ALL seem not requiring to be set, but I removed the locales errors by installing a missing locale with dpkg-reconfigure. So the warning disappeared. Question updated –  Pierre de LESPINAY May 31 '12 at 12:47
    
The chown: 'www-data': invalid user confuses me. I would have assumed the apache installer adds the user. You might want to manually add the user back (or determine why it was removed in the first place). –  Oliver Salzburg May 31 '12 at 12:49
    
The weird thing is that ps aux | grep httpd tell me that it's launched by the user 1003 which is not www-data. However grep "User " /etc/apache2/apache2.conf tells User www-data –  Pierre de LESPINAY May 31 '12 at 14:12
    
Your Apache installation seems quite broken. What you're reporting isn't weird at all. The process is running with a numeric ID because the user that had that ID was deleted (www-data). As long as the user is not restored, Apache won't update. But if that user account was removed, who knows what else is broken. –  Oliver Salzburg May 31 '12 at 14:50
show 1 more comment

1 Answer

Someone has deleted the www-data user from the system. You've reconfigured Apache to use a different user, and that's fine, but www-data is part of the core set of system users that Debian packages may assume exist, even though you're not using it. The postinst script for the apache2.2-common package is changing ownership of some file to that user and assuming it exists, and failing if it doesn't.

This appears to be fixed in the Apache packages in Debian 6.0. Debian 4.0 is quite old. But the immediate workaround would be to recreate the www-data user.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.