Edit report at https://bugs.php.net/bug.php?id=61951&edit=1

 ID:                 61951
 Updated by:         m...@php.net
 Reported by:        stolen dot data dot net at gmail dot com
 Summary:            "make install" script fails when prefix dir is a
                     symbolic link
-Status:             Open
+Status:             Feedback
 Type:               Bug
 Package:            Compile Failure
 Operating System:   Any
 PHP Version:        5.4.2
 Block user comment: N
 Private report:     N

 New Comment:

Please try using this snapshot:

  http://snaps.php.net/php5.4-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/

Works fine here.

$ make install
Installing PHP CLI binary:        /tmp/php-5.4/sym/bin/
Installing PHP CLI man page:      /tmp/php-5.4/sym/php/man/man1/
Installing PHP CGI binary:        /tmp/php-5.4/sym/bin/
Installing PHP CGI man page:      /tmp/php-5.4/sym/php/man/man1/
Installing build environment:     /tmp/php-5.4/sym/lib/php/build/
Installing header files:          /tmp/php-5.4/sym/include/php/
Installing helper programs:       /tmp/php-5.4/sym/bin/
  program: phpize
  program: php-config
Installing man pages:             /tmp/php-5.4/sym/php/man/man1/
  page: phpize.1
  page: php-config.1
$ cat config.nice
#! /bin/sh
#
# Created by configure

'/home/mike/src/php-5.4/configure' \
'--cache-file=config.cache' \
'--disable-all' \
'--prefix=/tmp/php-5.4/sym' \
"$@"
$ ls -ld sym
lrwxrwxrwx 1 mike users 4  1. Okt 15:07 sym -> real
$ ls -ld real
drwxr-xr-x 6 mike users 120  1. Okt 15:55 real


Previous Comments:
------------------------------------------------------------------------
[2012-05-07 19:25:36] stolen dot data dot net at gmail dot com

Specifically, the PHP Makefile fails when the destination of the symbolic link 
doesn't end with a trailing slash.


This will cause the new Makefile to fail...:

drwxr-xr-x   9 root  wheel  512 May  7 21:21 php542
lrwxr-xr-x   1 root  wheel    7 May  7 21:10 php -> php542


...but the Makefile bug doesn't manifest itself in this case:

drwxr-xr-x   9 root  wheel  512 May  7 21:21 php542
lrwxr-xr-x   1 root  wheel    7 May  7 21:10 php -> php542/


(Note the trailing slash at the end of the symbolic link destination...)

------------------------------------------------------------------------
[2012-05-05 11:00:50] stolen dot data dot net at gmail dot com

Description:
------------
I've been using a symbolic link scheme for the prefix destination dir of 
PHP/Apache/etc. software that I compile myself for over ten years now, to 
easily 
and quickly switch between releases in case of problems showing up when I move 
to a new version:

# ls -l /usr/opt
drwxr-xr-x   6 root  wheel  512 Mar 20  2011 php536
drwxr-xr-x   6 root  wheel  512 Dec 11 12:44 php538
drwxr-xr-x  16 root  wheel  512 May  5 11:02 php542
lrwxr-xr-x   1 root  wheel    6 May  5 11:02 php -> php542
...

./configure --prefix=/usr/opt/php --other-flags

If something goes wrong, I just shut down the servers, change the symbolical 
link, restart... You get the idea...

It is not a problem with any earlier version of PHP, but as of PHP 5.4.0 
something changed in the "install" portion of the Makefile that breaks this 
handy practice:

# make install
Installing PHP CLI binary:        /usr/opt/php/bin/
Installing PHP CLI man page:      /usr/opt/php/php/man/man1/
mkdir: /usr/opt/php/php: File exists
mkdir: /usr/opt/php/php/man: Too many levels of symbolic links
mkdir: /usr/opt/php/php/man/man1: Too many levels of symbolic links
*** Error code 1

Stop in /usr/opt/php-5.4.2 (line 243 of Makefile).


And when I take a look at what the install script has been doing:

# cd /usr/opt/php
# ls -l
total 4
drwxr-xr-x  2 root  wheel  512 May  5 13:43 bin
lrwxr-xr-x  1 root  wheel    3 May  5 11:02 php -> php


For some reason, when the prefix dir is a symbolic link, the 5.4.x Makefile 
creates a symbolic link to itself inside the prefix dir. Note also that the 
timestamp of the symbolic is identical to the actual symbolic link I make for 
the prefix destination, as if the Makefile tries to copy the directory into 
itself.

The problem is easily solved by entering the prefix dir, removing the broken 
link that the install script creates and just "mkdir php", then resuming "make 
install" again.

This shouldn't be needed, obviously. The script shouldn't fail just because the 
prefix happens to be a symbolic link to an actual destination sitting in the 
same directory - there are no technical complications caused by this handy 
practice.




------------------------------------------------------------------------



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=61951&edit=1

Reply via email to