php5 -> php53 how?

nORKy said:
I use portmaster. My /usr/local is empty because I have "NO package installed".
I try to compilte this:

Code:
databases/php53-pdo_dblib
databases/php53-pdo_mysql
databases/php53-mssql
graphics/php53-gd
lang/php53
lang/php53-extensions

The bug comes when it installs php53-extensions-1.6 => php53 => pdflib => php5-gd (bug here) => php54 (conflics because of php53-extensions installed php53).

I solved my problem. I put
Code:
PHP_VER=53
in /etc/make.conf
 
Ok, small error in this how-to, the last line is incorrect. The portname in this case of course is still php5-5.3.11. We can rename the entries in /var/db/pkg just as well, so the procedure would be:

Code:
# rename dirs that contain options files from php5* to php53*
cd /var/db/ports ; for f in php* ; do mv $f php53${f#php5}; done

# replace 'php5-' for 'php53-' in all options files
grep -rl 'php5-' /var/db/ports/*/options | sort -u | xargs sed -i '' 's|php5-|php53-|g'

# replace 'php5-' for 'php53-' in all +CONTENTS and +REQUIRED_BY files (portnames, (DEP)ORIGIN's) in /var/db/pkg
grep -Erl 'php5-|lang/php5' /var/db/pkg/*/+CONTENTS /var/db/pkg/*/+REQUIRED_BY | sort -u | xargs sed -i '' 's|php5-|php53-|g;s|lang/php5|lang/php53|g'

[b]# rename the php entries in /var/db/pkg:
cd /var/db/pkg ; for f in php* ; do mv $f php53${f#php5}; done[/b]

# if you use portinstall/portupgrade, then:

pkgdb -fu

# you should be able to upgrade php53-3.11 as normal:

portupgrade -pb php53-3.11  (should give you php53-3-13).

I just now upgraded a machine with php5-5.3.9 with this howto, and it worked fine!
 
frijsdijk said:
Ok, small error in this how-to, the last line is incorrect. The portname in this case of course is still php5-5.3.11. We can rename the entries in /var/db/pkg just as well, so the procedure would be:

The script should rename the contents of the files inside php5 in /var/db/pkg as well.
 
Mayhem30 said:
Are the solutions offered here the only way to fix this mess?

You can always contact the port maintainer.

The solutions you see here are from sysadmins who had to deal with these issues and figured out a way to minimize down time.
 
I tried contacting the port maintainer twice this past week .. and no response.

I'm assuming they really don't care about fixing this mess.
 
I decided to give the workaround a shot, and have issues with the first line.

cd /var/db/ports ; for f in php* ; do mv $f php53${f#php5}; done

That line throws an error (when using bin/ch) : Missing }

I logged out of root and tried :

Code:
sudo cd /var/db/ports ; for f in php* ; do mv $f php53${f#php5}; done

and that gives me the following error :

Code:
mv: rename php* to php53php*: No such file or directory

I'm not sure what to do next ...
 
My mistake! I just wanted to confirm something before continuing - does this look right?

After running :

Code:
cd /var/db/ports ; for f in php* ; do mv $f php53${f#php5}; done

The directory looks like this :

Code:
[root@localhost /var/db/ports]# ls php*
php53:
options

php53-dba:
options

php53-extensions:
options

php53-gd:
options

php53-mbstring:
options

php53-mysql:
options

php53-mysqli:
options

php53-pcre:
options

php53-pdo_mysql:
options

php53-sqlite:
options

php532:
options

php532-extensions:
options

php53phpMyAdmin:
options
[root@localhost /var/db/ports]#
 
After following the instruction in this thread, I'm running in to issues.

Code:
# rename dirs that contain options files from php5* to php53*
cd /var/db/ports ; for f in php* ; do mv $f php53${f#php5}; done

# replace 'php5-' for 'php53-' in all options files
grep -rl 'php5-' /var/db/ports/*/options | sort -u | xargs sed -i '' 's|php5-|php53-|g'

# replace 'php5-' for 'php53-' in all +CONTENTS and +REQUIRED_BY files (portnames, (DEP)ORIGIN's) in /var/db/pkg
grep -Erl 'php5-|lang/php5' /var/db/pkg/*/+CONTENTS /var/db/pkg/*/+REQUIRED_BY | sort -u | xargs sed -i '' 's|php5-|php53-|g;s|lang/php5|lang/php53|g'

# rename the php entries in /var/db/pkg:
cd /var/db/pkg ; for f in php* ; do mv $f php53${f#php5}; done


This is what pkg_version -v shows :

Code:
php53-5.3.13                        !   Comparison failed
php53-extensions-1.6                !   Comparison failed

Also, "phpMyAdmin-3.5.1" has now been renamed to "php53MyAdmin-3.5.1".

How can I fix this?
 
frijsdijk said:
Ok, small error in this how-to, the last line is incorrect. The portname in this case of course is still php5-5.3.11. We can rename the entries in /var/db/pkg just as well, so the procedure would be:

Code:
# rename dirs that contain options files from php5* to php53*
cd /var/db/ports ; for f in php* ; do mv $f php53${f#php5}; done

# replace 'php5-' for 'php53-' in all options files
grep -rl 'php5-' /var/db/ports/*/options | sort -u | xargs sed -i '' 's|php5-|php53-|g'

# replace 'php5-' for 'php53-' in all +CONTENTS and +REQUIRED_BY files (portnames, (DEP)ORIGIN's) in /var/db/pkg
grep -Erl 'php5-|lang/php5' /var/db/pkg/*/+CONTENTS /var/db/pkg/*/+REQUIRED_BY | sort -u | xargs sed -i '' 's|php5-|php53-|g;s|lang/php5|lang/php53|g'

[b]# rename the php entries in /var/db/pkg:
cd /var/db/pkg ; for f in php* ; do mv $f php53${f#php5}; done[/b]

# if you use portinstall/portupgrade, then:

pkgdb -fu

# you should be able to upgrade php53-3.11 as normal:

portupgrade -pb php53-3.11  (should give you php53-3-13).

I just now upgraded a machine with php5-5.3.9 with this howto, and it worked fine!

I normally do a # portupgrade -arR every three to six months to update all the software on my home server. Whilst checking /usr/ports/UPDATING today before doing so, I saw that I would be switched over to PHP 5.4, which I would rather avoid. After following the above instructions, I get
Code:
# portupgrade -npb php5-3.10
--->  Session started at: Tue, 14 Aug 2012 20:05:09 -0500
** None has been installed or upgraded.
--->  Session ended at: Tue, 14 Aug 2012 20:05:09 -0500 (consumed 00:00:00)
I don't normally use -pb so not sure if that is an issue. Next I did
Code:
# portupgrade -anrR
--->  Session started at: Tue, 14 Aug 2012 19:29:40 -0500
** Port marked as IGNORE: archivers/php53-bz2:
	cannot install: doesn't work with PHP version : 5 (Doesn't support PHP 52 5)
** Port marked as IGNORE: textproc/php53-ctype:
	cannot install: doesn't work with PHP version : 5 (Doesn't support PHP 52 5)
** Port marked as IGNORE: ftp/php53-curl:
	cannot install: doesn't work with PHP version : 5 (Doesn't support PHP 52 5)
** Port marked as IGNORE: textproc/php53-dom:
	cannot install: doesn't work with PHP version : 5 (Doesn't support PHP 52 5)
** Port directory not found: lang/php533-extensions
** Port marked as IGNORE: sysutils/php53-fileinfo:
	cannot install: doesn't work with PHP version : 5 (Doesn't support PHP 52 5)
** Port marked as IGNORE: security/php53-filter:
	cannot install: doesn't work with PHP version : 5 (Doesn't support PHP 52 5)
** Port marked as IGNORE: graphics/php53-gd:
	cannot install: doesn't work with PHP version : 5 (Doesn't support PHP 52 5)
** Port marked as IGNORE: security/php53-hash:
	cannot install: doesn't work with PHP version : 5 (Doesn't support PHP 52 5)
** Port marked as IGNORE: converters/php53-iconv:
	cannot install: doesn't work with PHP version : 5 (Doesn't support PHP 52 5)
** Port marked as IGNORE: devel/php53-json:
	cannot install: doesn't work with PHP version : 5 (Doesn't support PHP 52 5)
** Port marked as IGNORE: converters/php53-mbstring:
	cannot install: doesn't work with PHP version : 5 (Doesn't support PHP 52 5)
** Port marked as IGNORE: security/php53-mcrypt:
	cannot install: doesn't work with PHP version : 5 (Doesn't support PHP 52 5)
** Port marked as IGNORE: databases/php53-mysql:
	cannot install: doesn't work with PHP version : 5 (Doesn't support PHP 52 5)
** Port marked as IGNORE: databases/php53-mysqli:
	cannot install: doesn't work with PHP version : 5 (Doesn't support PHP 52 5)
** Port marked as IGNORE: security/php53-openssl:
	cannot install: doesn't work with PHP version : 5 (Doesn't support PHP 52 5)
** Port marked as IGNORE: databases/php53-pdo:
	cannot install: doesn't work with PHP version : 5 (Doesn't support PHP 52 5)
** Port marked as IGNORE: databases/php53-pdo_mysql:
	cannot install: doesn't work with PHP version : 5 (Doesn't support PHP 52 5)
** Port marked as IGNORE: databases/php53-pdo_sqlite:
	cannot install: doesn't work with PHP version : 5 (Doesn't support PHP 52 5)
** Port marked as IGNORE: archivers/php53-phar:
	cannot install: doesn't work with PHP version : 5 (Doesn't support PHP 52 5)
** Port marked as IGNORE: www/php53-session:
	cannot install: doesn't work with PHP version : 5 (Doesn't support PHP 52 5)
** Port marked as IGNORE: textproc/php53-simplexml:
	cannot install: doesn't work with PHP version : 5 (Doesn't support PHP 52 5)
** Port marked as IGNORE: net/php53-sockets:
	cannot install: doesn't work with PHP version : 5 (Doesn't support PHP 52 5)
** Port marked as IGNORE: databases/php53-sqlite3:
	cannot install: doesn't work with PHP version : 5 (Doesn't support PHP 52 5)
** Port marked as IGNORE: devel/php53-tokenizer:
	cannot install: doesn't work with PHP version : 5 (Doesn't support PHP 52 5)
** Port marked as IGNORE: textproc/php53-xml:
	cannot install: doesn't work with PHP version : 5 (Doesn't support PHP 52 5)
** Port marked as IGNORE: archivers/php53-zip:
	cannot install: doesn't work with PHP version : 5 (Doesn't support PHP 52 5)
** Port marked as IGNORE: archivers/php53-zlib:
	cannot install: doesn't work with PHP version : 5 (Doesn't support PHP 52 5)
--->  Upgrade of graphics/png started at: Tue, 14 Aug 2012 19:30:10 -0500
--->  Upgrading 'png-1.4.11' to 'png-1.5.12' (graphics/png)
OK? [no]
--->  Upgrade of graphics/png ended at: Tue, 14 Aug 2012 19:30:10 -0500 (consumed 00:00:00)
...
[snip]
...
--->  ** Upgrade tasks 31: 28 done, 28 ignored, 0 skipped and 0 failed
--->  Upgrade of lang/php53 started at: Tue, 14 Aug 2012 19:30:17 -0500
--->  Upgrading 'php53-5.3.10_1' to 'php53-5.3.15' (lang/php53)
OK? [no]
--->  Upgrade of lang/php53 ended at: Tue, 14 Aug 2012 19:30:17 -0500 (consumed 00:00:00)
--->  ** Upgrade tasks 31: 29 done, 28 ignored, 0 skipped and 0 failed
--->  Skipping 'print/pecl-pdflib' (pecl-pdflib-2.1.8_1) because a requisite package 'php53-gd-5.3.10_1' (graphics/php53-gd) failed (specify -k to force)
--->  ** Upgrade tasks 31: 29 done, 28 ignored, 1 skipped and 0 failed
--->  Skipping 'databases/phpmyadmin' (phpMyAdmin-3.5.0) because a requisite package 'php53-gd-5.3.10_1' (graphics/php53-gd) failed (specify -k to force)
--->  ** Upgrade tasks 31: 29 done, 28 ignored, 2 skipped and 0 failed
--->  Listing the results (+:done / -:ignored / *:skipped / !:failed)
	- archivers/php53-bz2 (marked as IGNORE)
	- textproc/php53-ctype (marked as IGNORE)
	- ftp/php53-curl (marked as IGNORE)
	- textproc/php53-dom (marked as IGNORE)
	- lang/php533-extensions (port directory error)
	- sysutils/php53-fileinfo (marked as IGNORE)
	- security/php53-filter (marked as IGNORE)
	- graphics/php53-gd (marked as IGNORE)
	- security/php53-hash (marked as IGNORE)
	- converters/php53-iconv (marked as IGNORE)
	- devel/php53-json (marked as IGNORE)
	- converters/php53-mbstring (marked as IGNORE)
	- security/php53-mcrypt (marked as IGNORE)
	- databases/php53-mysql (marked as IGNORE)
	- databases/php53-mysqli (marked as IGNORE)
	- security/php53-openssl (marked as IGNORE)
	- databases/php53-pdo (marked as IGNORE)
	- databases/php53-pdo_mysql (marked as IGNORE)
	- databases/php53-pdo_sqlite (marked as IGNORE)
	- archivers/php53-phar (marked as IGNORE)
	- www/php53-session (marked as IGNORE)
	- textproc/php53-simplexml (marked as IGNORE)
	- net/php53-sockets (marked as IGNORE)
	- databases/php53-sqlite3 (marked as IGNORE)
	- devel/php53-tokenizer (marked as IGNORE)
	- textproc/php53-xml (marked as IGNORE)
	- archivers/php53-zip (marked as IGNORE)
	- archivers/php53-zlib (marked as IGNORE)
	+ graphics/png (png-1.4.11)
	+ devel/m4 (m4-1.4.16,1)
	+ net/rsync (rsync-3.0.9)
	+ net/openldap24-client (openldap-client-2.4.31)
	+ databases/mysql51-client (mysql-client-5.1.62)
	+ misc/help2man (help2man-1.40.9)
	+ lang/python26 (python26-2.6.8)
	+ devel/autoconf (autoconf-2.68)
	+ textproc/libxml2 (libxml2-2.7.8_2)
	+ databases/sqlite3 (sqlite3-3.7.11)
	+ sysutils/smartmontools (smartmontools-5.42_3)
	+ devel/automake (automake-1.11.1)
	+ graphics/tiff (tiff-4.0.1_1)
	+ lang/tcl-modules (tcl-modules-8.5.11)
	+ lang/ruby18 (ruby-1.8.7.358,1)
	+ devel/bison (bison-2.5,1)
	+ ports-mgmt/portupgrade (portupgrade-2.4.9.4,2)
	+ shells/bash (bash-4.2.24)
	+ security/ca_root_nss (ca_root_nss-3.13.4)
	+ dns/libidn (libidn-1.22)
	+ dns/dnsmasq (dnsmasq-2.60_1,1)
	+ print/pdflib (pdflib-7.0.5)
	+ lang/tcl85 (tcl-8.5.11)
	+ x11/xcb-proto (xcb-proto-1.7)
	+ devel/pcre (pcre-8.30_2)
	+ databases/mysql51-server (mysql-server-5.1.62)
	+ net/samba35 (samba35-3.5.14_1)
	+ www/apache22 (apache-2.2.22_5)
	+ lang/php53 (php53-5.3.10_1)
	* print/pecl-pdflib (pecl-pdflib-2.1.8_1)
	* databases/phpmyadmin (phpMyAdmin-3.5.0)
--->  Packages processed: 29 done, 28 ignored, 2 skipped and 0 failed
--->  Session ended at: Tue, 14 Aug 2012 19:30:17 -0500 (consumed 00:00:36)
to see what would go down if I tried to do my normal upgrade. All of the PHP extensions get marked as IGNORE. If I do the upgrade as per above, and considering that lang/php53 gets upgraded, will an immediate identical upgrade afterwards cause the extensions to get upgraded? If not, what is the best way to go about fixing this.

Your expertise is much appreciated. Thanks.

Dave.
 
thanks for the procedure, and I agree backup extensions.ini because also not all extensions are in the php53-extensions ports eg. pecl-memcache.

So ehen I did this memcache was not enabled in php and I had to reinstall that port. So backing up the extensions.ini gives a reference point to make sure you reinstalled all extensions.
 
Back
Top