Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Problem with PHP cli
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
filbar
n00b
n00b


Joined: 23 Nov 2005
Posts: 11

PostPosted: Sun Oct 05, 2014 11:52 am    Post subject: Problem with PHP cli Reply with quote

I have from sime time problem with PHP cli interface. When I call PHP I have this error:

/usr/bin/php: error: `/usr/lib64/php5.5/bin/.libs/php' does not exist
This script is just a wrapper for php.
See the libtool documentation for more information.

I have PHP installed as:
[ebuild R ] dev-lang/php-5.5.15:5.5 USE="apache2 berkdb bzip2 calendar cgi cli crypt ctype curl exif fileinfo filter ftp gd gdbm gmp hash iconv
imap intl ipv6 json ldap mysql mysqli nls opcache pdo phar posix readline session simplexml soap spell sqlite ssl sysvipc tokenizer truetype unicode xml
xmlreader xmlrpc xmlwriter xpm xslt zip zlib -bcmath -cdb -cjk -debug -embed -enchant (-firebird) -flatfile -fpm (-frontbase) -inifile -iodbc -kerberos
-ldap-sasl -libedit -libmysqlclient -mhash -mssql -oci8-instant-client -odbc -pcntl -postgres -qdbm -recode (-selinux) -sharedmem -snmp -sockets
(-sybase-ct) -systemd -threads -tidy -wddx" 0 kB

What I have wrong?
Back to top
View user's profile Send private message
miket
Guru
Guru


Joined: 28 Apr 2007
Posts: 488
Location: Gainesville, FL, USA

PostPosted: Mon Oct 06, 2014 3:09 pm    Post subject: Reply with quote

I think the symlink might be wrong. Try
Code:
ls -l /usr/bin/php
This should show up as being a symlink; you should see it point to /usr/lib64/php5.5/bin/php. I'll bet that in your system you're getting /usr/lib64/php5.5/bin/.libs/php instead.

I don't know why that would happen, but this is an easy thing to try: eselect to reset the symlink.

First, run
Code:
eselect php list cli
Note which of these entries is for php5.5. (You might have only 5.5; in that case it's numbered as the first choice). In any event, re-select it with eselect. Substitute the 1 in the following command with whatever number corresponds to php5.5
Code:
eselect php set cli 1
Back to top
View user's profile Send private message
filbar
n00b
n00b


Joined: 23 Nov 2005
Posts: 11

PostPosted: Tue Oct 07, 2014 4:34 pm    Post subject: Reply with quote

This was a first thing what i make.
Back to top
View user's profile Send private message
miket
Guru
Guru


Joined: 28 Apr 2007
Posts: 488
Location: Gainesville, FL, USA

PostPosted: Tue Oct 07, 2014 7:00 pm    Post subject: Reply with quote

Pardon me if I didn't quite understand your answer. Do you mean to say that you tried to do the eselect when you first had the problem?

To further clarify the issue, let's see if the CLI executable for PHP 5.5 is where it is supposed to be and acts correctly. Try running this command:
Code:
/usr/lib64/php5.5/bin/php  -r 'echo "hello\n";'


If that displays anything other than hello, you've got a problem with the installation. Maybe that's causing a problem for eselect.

With your USE flags you've enabled the CLI, CGI, and mod_php SAPI's. This ought to work.

Let me know what the output is.
Back to top
View user's profile Send private message
filbar
n00b
n00b


Joined: 23 Nov 2005
Posts: 11

PostPosted: Fri Oct 17, 2014 6:27 pm    Post subject: Reply with quote

This give me me the message:
Code:

/usr/lib64/php5.5/bin/php: error: `/usr/lib64/php5.5/bin/.libs/php' does not exist
This script is just a wrapper for php.
See the libtool documentation for more information

The /usr/lib64/php5.5/bin/php is some shell script in the head it has:
Code:

#! /bin/sh

# sapi/cli/php - temporary wrapper script for .libs/php
# Generated by libtool (GNU libtool) 2.4.2
#
# The sapi/cli/php program cannot be directly executed until all the libtool
# libraries that it depends on are installed.
#
# This wrapper script should never be moved out of the build directory.
# If it is, it will not operate correctly.

# Sed substitution that helps us do robust quoting.  It backslashifies
# metacharacters that are still active within double-quoted strings.

I have enabled cli and cgi flags on PHP too and the eselect command give me the output:
Code:

 eselect php list cli
  [1]   php5.5 *
 eselect php show cli
php5.5
Back to top
View user's profile Send private message
miket
Guru
Guru


Joined: 28 Apr 2007
Posts: 488
Location: Gainesville, FL, USA

PostPosted: Sat Oct 18, 2014 2:32 am    Post subject: Reply with quote

Ohh my. I don't know how your system could get into such a state, but there it is. I had never known that libtool could make little wrapper scripts like that. I infer from "cannot be directly executed until all the libtool libraries that it depends on are installed" that you have dependencies that are missing or at the wrong revisions.

My impression is that what your system needs is a good revdep-rebuild. Newer versions of Portage are supposed to reduce the need for it, but I think you're in one of those tricky situations now where it is still necessary.

If you don't already have gentoolkit installed, you'll have to take care of that first:
Code:
emerge app-portage/gentoolkit


Now run revdep-rebuild in Pretend mode and notice what packages it wants to rebuild:
Code:
revdep-rebuild -vp


This will chug on for a while and then display the list of packages it needs to re-merge. Take a look in this list to see if it wants to rebuild PHP 5.5. I bet it will. If it's in this list, good.

Now run revdep-rebuild without the -p and wait for it all. When it finishes, you can try running the PHP CLI. If it still doesn't work (especially if you didn't see it scheduled for rebuild when you ran revdep-rebuild the first time), re-emerge PHP.
Back to top
View user's profile Send private message
filbar
n00b
n00b


Joined: 23 Nov 2005
Posts: 11

PostPosted: Sun Oct 19, 2014 12:18 pm    Post subject: Reply with quote

This is the think which I do after every update. Now I try unmerge and emerge PHP again, but the php CLI don't works. The funniest think is that all other gentoo and portage works well and mod_php too, then only broken is php cli and cgi.
I don't know how libtool works and how can I debug why is wrapper script installed instead of real php cli and cgi.
Back to top
View user's profile Send private message
miket
Guru
Guru


Joined: 28 Apr 2007
Posts: 488
Location: Gainesville, FL, USA

PostPosted: Mon Oct 20, 2014 3:16 am    Post subject: Reply with quote

This is perplexing. I do have one theory at the moment. Maybe this might hold the solution: emerge's treatment of file collisions.

You know how Portage sometimes complains that a package contains files to be installed that seem not to be from previous versions of a package but were put there some other way? Portage tries to identify the packages in such a case, but it can't always do so. When libtool (or lafilefixer maybe) replaced that /usr/lib64/php5.5/bin/php it may have made it so that emerge would not remove it when you unmerged PHP, but then when you re-merged the package, there was a collision which emerge resolved by not overwriting the existing file.

It seems like this is shooting in the dark, but it does leave you something to try: unmerge php:5.5, check whether that odd libtool-generated script is still there, remove it if so, and then re-merge php.

For reference, here are the executable files (include .so's) I have installed for PHP 5.5. I've got the fpm USE flag instead of cgi (hence php-fpm; I was trying it out), but your files ought to be similar:
Code:
/usr/bin/php-fpm5.5 -> /usr/lib64/php5.5/bin/php-fpm
/usr/bin/php5.5 -> /usr/lib64/php5.5/bin/php
/usr/lib64/php5.5/apache2/libphp5.so
/usr/lib64/php5.5/bin/php
/usr/lib64/php5.5/bin/php-config
/usr/lib64/php5.5/bin/php-fpm
/usr/lib64/php5.5/bin/phpize
/usr/lib64/php5.5/lib64/libphp5.so
/usr/lib64/php5.5/lib64/opcache.so


After unmerging, check that none of these files still exist before merging php again.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum