User avatar
nerdykit
Posts: 12
Joined: Tue Jan 15, 2013 5:30 pm
Location: Vancouver, BC

php7 startup warnings invalid ELF header

Mon Mar 12, 2018 1:13 am

I've got a working Apache2 webserver with php7 and mysqli but I'm getting a group of warnings in the apache error log that indicates that a group of about 8 library modules are not loading. Here's that section of the log...
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/iconv.so' - /usr/lib/php/20151012/iconv.so: invalid ELF header in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/ftp.so' - /usr/lib/php/20151012/ftp.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/gettext.so' - /usr/lib/php/20151012/gettext.so: invalid ELF header in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/iconv.so' - /usr/lib/php/20151012/iconv.so: invalid ELF header in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/posix.so' - /usr/lib/php/20151012/posix.so: invalid ELF header in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/shmop.so' - /usr/lib/php/20151012/shmop.so: invalid ELF header in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/sysvmsg.so' - /usr/lib/php/20151012/sysvmsg.so: invalid ELF header in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/sysvsem.so' - /usr/lib/php/20151012/sysvsem.so: invalid ELF header in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/sysvshm.so' - /usr/lib/php/20151012/sysvshm.so: invalid ELF header in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/tokenizer.so' - /usr/lib/php/20151012/tokenizer.so: invalid ELF header in Unknown on line 0
I've done as much research as I can. All of the .so files are actually in place so it doesn't seem to be a problem where a .ini file is calling for the load but the file isn't present. From my reading, I suspect that somehow the compiled version I've ended up with for these modules is not the correct one for my version of php7 (7.0.27-0+deb9u1). My Raspbian version is 9 (stretch). The reason that iconv occurs twice is that I was experimenting with php.ini to see if it needed the full path so it's trying to load from two different calls (I've got to take that back out of there). I also note that I can't actually issue any CLI commands to php, all I get in response is "Segmentation fault" so I further suspect that the CLI version of php is either not installed or not working properly.

So do I have to re-install php ? Is there any way to save this setup and just correct the bad versions of these libraries without actually re-installing php. I'm not even sure if re-installing will install these libraries. Some of them may be dependents.

Just learned from searching that posix module is now built into php7 core. Maybe that is true for more of these. The modules are not loaded from php.ini I think it gets loaded from the matching ini file in /etc/php/7.0/apache2/conf.d/ is that correct. If so I can disable that module by moving the appropriate ini file out of that directory. Is that the correct way to shut off the call to load one of these modules?

So what to do from here? Thanks for any help/suggestions.

NK
What me...?

User avatar
topguy
Posts: 5626
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: php7 startup warnings invalid ELF header

Mon Mar 12, 2018 12:23 pm

And you have not messed with where apt get its packages from or anything ?

I'll suggest a reinstall of "php7.0-common" package.

User avatar
nerdykit
Posts: 12
Joined: Tue Jan 15, 2013 5:30 pm
Location: Vancouver, BC

Re: php7 startup warnings invalid ELF header

Mon Mar 12, 2018 6:28 pm

Thanks for the suggestion. I might have done that as I followed some on-line "cookbook" instructions for the LAMP install but it was months ago and now I can't remember. Is there a way to ask APT to display what its list of sources is so that I can make sure that I'm using only approved sources before I try what you've suggested?

NK
What me...?

User avatar
nerdykit
Posts: 12
Joined: Tue Jan 15, 2013 5:30 pm
Location: Vancouver, BC

Re: php7 startup warnings invalid ELF header

Mon Mar 12, 2018 6:33 pm

Answers own query....

Use this (as root?) to create a file with the current list of apt sources....

grep -h ^deb /etc/apt/sources.list /etc/apt/sources.list.d/* >> current.repos.list

then a cat of current.repos.list gives me

deb http://mirrordirector.raspbian.org/raspbian/ stretch main contrib non-free rpi
deb http://archive.raspberrypi.org/debian/ stretch main ui

so it looks to me as if my sources are "clean" Will try the re-install of php7.0-common

Thanks

NK
What me...?

User avatar
nerdykit
Posts: 12
Joined: Tue Jan 15, 2013 5:30 pm
Location: Vancouver, BC

Re: php7 startup warnings invalid ELF header

Mon Mar 12, 2018 11:44 pm

and further...

sudo apt-get --reinstall install php7.0-cli

got me back to a php that will also work from the command line.

Thanks for the pointer, topguy

NK
What me...?

Return to “Raspbian”