# php5-extensions won't install



## mdudley (Feb 17, 2011)

I am trying to install lang/php5-extensions.  When I do a *make* I get the following error:


```
===>   php5-extensions-1.4 depends on file: /usr/local/include/php/main/php.h - found
===>   php5-extensions-1.4 depends on file: /usr/local/lib/php/20090626/ctype.so - not found
===>    Verifying install for /usr/local/lib/php/20090626/ctype.so in /usr/ports/textproc/php5-ctype
===>   php5-ctype-5.3.5 depends on file: /usr/local/bin/phpize - found
===>   php5-ctype-5.3.5 depends on file: /usr/local/bin/autoconf-2.68 - found
===>  PHPizing for php5-ctype-5.3.5
cd: can't cd to /usr/ports/textproc/php5-ctype/work/php-5.3.5/ext/ctype
*** Error code 2

Stop in /usr/ports/textproc/php5-ctype.
*** Error code 1

Stop in /usr/ports/lang/php5-extensions.
*** Error code 1

Stop in /usr/ports/lang/php5-extensions.
```

I have done a *portsnap* to the latest and reinstalled autoupdate and php5. There is no directory /usr/local/lib/php/20090626/ but there is a directory of /usr/local/lib/php/20060613 from when it was installed earlier with ctype.so in it, but dated from the earlier installation a year ago.

*phpinfo* is as follows, and although it says 20090626 in it, find does not find any directory with that designation:


```
PHP Version 5.3.5

System 	FreeBSD store.uscfsales.com 8.0-RELEASE FreeBSD 8.0-RELEASE #0: Sat Nov 21 15:02:08 UTC 2009 
[email]root@mason.cse.buffalo.edu[/email]:/usr/obj/usr/src/sys/GENERIC amd64
Build Date 	Feb 17 2011 11:41:37
Configure Command 	'./configure' '--with-layout=GNU' '--localstatedir=/var' '--with-config-file-scan-dir=/usr/local/etc/php' '--disable-
all' '--enable-libxml' '--with-libxml-dir=/usr/local' '--with-pcre-regex=/usr/local' '--with-zlib-dir=/usr' '--program-prefix=' '--with-
apxs=/usr/local/sbin/apxs' '--with-regex=php' '--with-zend-vm=CALL' '--prefix=/usr/local' '--mandir=/usr/local/man' '--
infodir=/usr/local/info/' '--build=amd64-portbld-freebsd8.0'
Server API 	Apache
Virtual Directory Support 	disabled
Configuration File (php.ini) Path 	/usr/local/etc
Loaded Configuration File 	/usr/local/etc/php.ini
Scan this dir for additional .ini files 	/usr/local/etc/php
Additional .ini files parsed 	/usr/local/etc/php/extensions.ini
PHP API 	20090626
PHP Extension 	20090626
Zend Extension 	220090626
Zend Extension Build 	API220090626,NTS
PHP Extension Build 	API20090626,NTS
Debug Build 	no
Thread Safety 	disabled
Zend Memory Manager 	enabled
Zend Multibyte Support 	disabled
IPv6 Support 	enabled
Registered PHP Streams 	php, file, glob, data, http, ftp
Registered Stream Socket Transports 	tcp, udp, unix, udg
Registered Stream Filters 	string.rot13, string.toupper, string.tolower, string.strip_tags, convert.*, consumed, dechunk

Suhosin logo This server is protected with the Suhosin Patch 0.9.10
Copyright (c) 2006-2007 Hardened-PHP Project Copyright (c) 2007-2009 SektionEins GmbH
```

Any assistance would be greatly appreciated.

Thanks,

Marshall


----------



## mdudley (Feb 18, 2011)

I believe that part of the problem is that the php installation does NOT create or populate the 20090626 directory, even though when you check it it says that is where the extensions are. How do you get the php to create and populate that directory when installing it?

Marshall


----------



## SirDice (Feb 18, 2011)

It sounds like your php5 and php5-extensions ports are out of sync.


----------



## mdudley (Feb 18, 2011)

I agree, but am unable to figure out how to sync them again.  I did a portsnap and all the ports are updated, and both have been deinstalled and reinstalled since the portsnap, but to no avail. I think the problem is that I did a deinstall on php and it did not deinstall everything from the older version, and now I can't figure out how to do a pkg_delete of it since I don't know what that version number was.

Marshall


----------



## SirDice (Feb 18, 2011)

Have a look with `# pkg_version -v`.

You can also try something like this:
`# pkg_delete -rx php5-`
(WARNING! This command will delete all php5 packages and everything that depends on them)


----------



## mdudley (Feb 18, 2011)

OK, I did the pkg_version and got this:


```
php5-5.3.5                          =   up-to-date with port
php5-bz2-5.2.12                     <   needs updating (port has 5.3.5)
php5-ctype-5.2.12                   <   needs updating (port has 5.3.5)
php5-dba-5.3.4                      <   needs updating (port has 5.3.5)
php5-gd-5.2.12                      <   needs updating (port has 5.3.5)
php5-mbstring-5.2.12                <   needs updating (port has 5.3.5)
php5-mcrypt-5.2.12                  <   needs updating (port has 5.3.5)
php5-mysql-5.2.12                   <   needs updating (port has 5.3.5)
php5-openssl-5.2.12                 <   needs updating (port has 5.3.5)
php5-session-5.2.12                 <   needs updating (port has 5.3.5)
php5-simplexml-5.2.12               <   needs updating (port has 5.3.5)
php5-zip-5.2.12                     <   needs updating (port has 5.3.5)
php5-zlib-5.2.12                    <   needs updating (port has 5.3.5)
```

So the version that did not get deleted properly was 5.2.12.  When I Try to do a *pkg_delete* of php5-5.2.12 it says no such package is installed.  It says I need to do an update of those ports, but isn't an update done when I do the update of php5? Since the php5 is up to date, why aren't the other things? And the php5-extensions won't install because the php-ctype is either out of date, or in the wrong place?  I seem to be stuck in a loop where a won't install because "b" is out of date, and "b" won't update.

Thanks,

Marshall


----------



## SirDice (Feb 18, 2011)

Ah, that explains a lot.. Before updating something you should make a habit of reading /usr/ports/UPDATING:


> 20100409:
> AFFECTS: users of lang/php5
> AUTHOR: ale@FreeBSD.org
> 
> ...



But since it's currently in a rather crappy state I'd delete all php5 packages and start over.


----------



## mdudley (Feb 18, 2011)

OK, I deleted everything I found in the pkg_info output, and used `pkg_delete -ix ^php5-` and verified they were all gone.

I then installed php5 again and it appears to have installed fine. But when I try to install the php5-extensions I am still getting the following errors:"


```
store# cd php5-extensions
store# make
===>   php5-extensions-1.4 depends on file: /usr/local/include/php/main/php.h - found
===>   php5-extensions-1.4 depends on file: /usr/local/lib/php/20090626/ctype.so - not found
===>    Verifying install for /usr/local/lib/php/20090626/ctype.so in /usr/ports/textproc/php5-ctype
===>   php5-ctype-5.3.5 depends on file: /usr/local/bin/phpize - found
===>   php5-ctype-5.3.5 depends on file: /usr/local/bin/autoconf-2.68 - found
===>  PHPizing for php5-ctype-5.3.5
cd: can't cd to /usr/ports/textproc/php5-ctype/work/php-5.3.5/ext/ctype
*** Error code 2

Stop in /usr/ports/textproc/php5-ctype.
*** Error code 1

Stop in /usr/ports/lang/php5-extensions.
*** Error code 1

Stop in /usr/ports/lang/php5-extensions.
```

The old /usr/local/lib/php/2006026/ directory is now gone, but still the needed new one is missing:


```
store# pwd
/usr/local/include/php
store# ls -l
total 8
drwxr-xr-x  2 root  wheel   512 Feb 18 12:54 TSRM
drwxr-xr-x  2 root  wheel  2048 Feb 18 12:54 Zend
drwxr-xr-x  9 root  wheel   512 Feb 18 12:53 ext
drwxr-xr-x  3 root  wheel  1024 Feb 18 12:54 main
```

Why does the install of php5 NOT create the directories needed by the extensions? How can I get it to do so?

Thanks,

Marshall


----------



## DutchDaemon (Feb 18, 2011)

@mdudley, *format your posts*, please.


----------



## SirDice (Feb 18, 2011)

mdudley said:
			
		

> Why does the install of php5 NOT create the directories needed by the extensions? How can I get it to do so?


That's probably because it doesn't get that far.

At least we cleared up some of the mess :e



> ```
> cd: can't cd to /usr/ports/textproc/php5-ctype/work/php-5.3.5/ext/ctype
> *** Error code 2
> ```



Try building this port separately:

```
cd /usr/ports/textproc/php5-ctype
make clean #clean up first
make extract
make install
```

The extract is not really necessary but it's to check if there's something going wrong. Make sure you have plenty of free space. If you ran out of disk space the distfile can't be properly extracted and it may be the source of the problem.


----------



## mdudley (Feb 18, 2011)

OK, before doing that, I have uncovered an oddity. There is about 30 Gig of disk space free.


```
store# ls -l
total 2
-rw-r--r--  1 root  wheel    0 Feb 17 11:30 .extract_done.php5._usr_local
-rw-r--r--  1 root  wheel    0 Feb 17 11:30 .patch_done.php5._usr_local
drwxr-xr-x  3 root  wheel  512 Feb 17 11:30 php-5.3.4
store# pwd
/usr/ports/textproc/php5-ctype/work
```

So you see there is a php-5.3.4 directory, but what is installed is php-5.3.5!

If I do a directory listing, the files are there, but the name of the sub-directory is wrong!


```
store# ls -l php-5.3.4/ext/ctype
total 808
-rw-r--r--  1 root  wheel      25 Nov 21  2000 CREDITS
-rw-r--r--  1 root  wheel    5498 Feb 17 11:36 Makefile.global
-rw-r--r--  1 root  wheel   75785 Feb 17 11:36 acinclude.m4
-rw-r--r--  1 root  wheel  306109 Feb 17 11:36 aclocal.m4
drwxr-xr-x  2 root  wheel     512 Feb 17 11:30 build
-rwxr-xr-x  1 root  wheel   42037 Feb 17 11:36 config.guess
-rw-r--r--  1 root  wheel     296 Mar 12  2002 config.m4
-rwxr-xr-x  1 root  wheel   30315 Feb 17 11:36 config.sub
-rw-r--r--  1 root  wheel     216 Dec  2  2003 config.w32
-rw-r--r--  1 root  wheel    4642 Feb 17 11:36 configure.in
-rw-r--r--  1 root  wheel    6722 Jan  3  2010 ctype.c
-rw-r--r--  1 root  wheel    4515 Jan 17  2004 ctype.dsp
-rw-r--r--  1 root  wheel    5872 Jul 14  2009 ctype.xml
-rw-r--r--  1 root  wheel       0 Feb 17 11:36 install-sh
-rw-r--r--  1 root  wheel  199728 Feb 17 11:36 ltmain.sh
-rw-r--r--  1 root  wheel       0 Feb 17 11:36 missing
-rw-r--r--  1 root  wheel       0 Feb 17 11:36 mkinstalldirs
-rw-r--r--  1 root  wheel    1269 Jul 14  2009 package.xml
-rw-r--r--  1 root  wheel    1441 Jan  3  2010 php_ctype.h
-rw-r--r--  1 root  wheel   69261 Feb 17 11:36 run-tests.php
drwxr-xr-x  2 root  wheel    2560 Dec  8 16:45 tests
store#
```

I just did a find for everything that has php-5.3.4 in it and that is all that was found.


```
store# find /usr -name php-5.3.4

/usr/ports/textproc/php5-ctype/work/php-5.3.4
store#
```

Should I delete this directory by hand since the pkg_delete seems to have missed it and try reinstalling php-5.3.5?

Marshall


----------



## SirDice (Feb 21, 2011)

The [cmd=]make clean[/cmd] will clean it.


----------



## mdudley (Mar 1, 2011)

Nope, that fails too. Here is what happened:

```
store# make clean
===>  Cleaning for php5-ctype-5.3.5
store# make extract
===>  Vulnerability check disabled, database not found
===>  License check disabled, port has not defined LICENSE
===>  Extracting for php5-ctype-5.3.5
=> SHA256 Checksum OK for php-5.3.5.tar.bz2.
store# make install
===>  Patching for php5-ctype-5.3.5
===>   php5-ctype-5.3.5 depends on file: /usr/local/bin/phpize - found
===>   php5-ctype-5.3.5 depends on file: /usr/local/bin/autoconf-2.68 - found
===>  PHPizing for php5-ctype-5.3.5
Configuring for:
PHP Api Version:         20090626
Zend Module Api No:      20090626
Zend Extension Api No:   220090626
autoconf: required version 2.68 not found
*** Error code 1

Stop in /usr/ports/textproc/php5-ctype.
store#
```

What do you suggest now?

Thanks,

Marshall


----------



## mdudley (Mar 6, 2011)

Can anyone please suggest anything else to try. It appears that ports does not work with the php extensions, and no one can offer a work around.  I have been working on this problem for 3 weeks now, and at every turn ports gives an error when trying to install the extensions or do any of the above suggestions. This is for a production system that must have these extensions on it.  I am willing to pay someone to work with me on the phone if necessary.

Marshall


----------



## mdudley (Apr 14, 2011)

Please someone, how the heck do you install this?

Nothing works and no one here seems to be able to help.  I have spent almost 2 months trying to get this installed, and everything generates an error.  Above you can see that it says that autoconf268 must be installed, but if I try to update it, it says it is already installed. I uninstall it and reinstall it, then clean and try to install the ctypes again, and still get the same message that says that it needs autoconf268, which I just successfully reinstalled. There is something badly wrong with this module, does anyone know how to get around the problems and get it installed?

Marshall


----------



## wblock@ (Apr 14, 2011)

It's possible you've missed the 20101208 entry in /usr/ports/UPDATING, and doing that would fix this.  But it's just a guess.


----------



## mdudley (Apr 14, 2011)

Nope, still no go.

I did what that entry called for, then deinstalled the autoconf and reinstalled it again.  Then I tried to install the ctype but get the same error:


```
store# make clean
===>  Cleaning for autoconf-2.68
===>  Cleaning for php5-ctype-5.3.5
store# make install
===>  Vulnerability check disabled, database not found
===>  License check disabled, port has not defined LICENSE
===>  Extracting for php5-ctype-5.3.5
=> SHA256 Checksum OK for php-5.3.5.tar.bz2.
===>  Patching for php5-ctype-5.3.5
===>   php5-ctype-5.3.5 depends on file: /usr/local/bin/phpize - found
===>   php5-ctype-5.3.5 depends on file: /usr/local/bin/autoconf-2.68 - found
===>  PHPizing for php5-ctype-5.3.5
Configuring for:
PHP Api Version:         20090626
Zend Module Api No:      20090626
Zend Extension Api No:   220090626
autoconf: required version 2.68 not found
*** Error code 1

Stop in /usr/ports/textproc/php5-ctype.
store#
```

Marshall


----------



## wblock@ (Apr 14, 2011)

It may not be an autoconf problem, but if it is, removing all installed versions of autoconf and automake is worth a try.  Let the php5-ctype port install what it needs as dependencies.
`# pkg_delete autoconf\* automake\*`

Might also want to throw libtool and libltdl in there.


----------



## chavez243ca (Apr 14, 2011)

[cmd=]#portversion -v | grep autoconf[/cmd]

What is your output for the above? Add to that: [cmd=]#pkgdb -F[/cmd] in case your package database is butchered.


----------



## turbo (Apr 28, 2011)

[SOLVED!]
I had the same issue updating from PHP 5.2.17 to 5.3.6.

Instead update, I decided to remove PHP52 and all the other modules, then strart a php 5.3.6 from scratch.

PHP 5.3.6 port was built without problems, however when trying to make php5-extensions (v1.5) it was complaining likewise...


```
===>   php5-extensions-1.5 depends on file: /usr/local/include/php/main/php.h - found
===>   php5-extensions-1.5 depends on file: /usr/local/lib/php/20090626/json.so - not found
```

Running
[CMD=""]portversion -v | grep autoconf[/CMD]

Revealed some staled dependencies that were fixed using
[CMD=""]pkgdb -F[/CMD]

I also removed these packages as suggested here, because some port was complainig about the version
[CMD=""]pkg_delete autoconf\* automake\*[/CMD]

Then, and I think that was the key to the solution, I deleted:
/usr/local/etc/php.ini

and

/usr/local/etc/php/extensions.ini

Which were left there by php 5.2.17.

I also deleted the saved options for php in /var/db/ports by running
[CMD=""]rm -r /var/db/ports/php5*[/CMD]


After that I started from scratch...
[CMD=""]cd /usr/ports/lang/php5[/CMD]
[CMD=""]make clean[/CMD]
[CMD=""]make install clean[/CMD]

Then the extenstions... ( I selected no extensions at all in the options! )
[CMD=""]cd /usr/ports/lang/php5-extensions[/CMD]
[CMD=""]make config[/CMD]
[CMD=""]make install[/CMD]

At this point, and as it was not the 1st attempt.. I started to add the modules I wanted for my php installation one at a time.
[CMD=""]make config[/CMD]
[CMD=""]make deinstall[/CMD]
[CMD=""]make reinstall[/CMD]

and that's it! battle won! 

Thanks for all the contributions here.
I wanted to share my case, as I finally managed to solve it in big part thanks to this forum


----------

