# Stop in /usr/ports/lang/php5-extensions



## c00kie (Apr 18, 2012)

*H*i,

I've installed *AMP on my FreeBSD 9 machine and now would like to extend PHP with support for Curl. OK, I'm stood in /usr/ports/lang/php5-extensions and issue the following commands:

`# make config`
I select options I would like: Curl, Xml etc...

then
`# make clean install`

All looks good until I reach:


```
===> Checking if lang/php5-extensions already installed
===> php5-extensions-1.6 is already installed
You may wish to ''make deinstall'' and install this port again
by ''make reinstall'' to upgrade it properly.
If you reall wish to overwrite the old port of lang/php5-extensions
without deleting it first, set the variable "FORCE_PKG_REGISTER"
in your environment or the "make install" command line.
*** Error code 1

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

You*'re*r thinking well, the message is there plain to see, so get on with it. If only things were that simple. Looking around at some posts, and stood in /usr/ports/lang/php5-extensions  I try:
`# make FORCE_PKG_REGISTER=1 install`


```
===> Installing for php5-extensions-1.6
===> php5-extensions-1.6 depends on file: /usr/local/include/php/main/php.h - found

...

found 

...

found all OK

===> Generating temporary packing list
===> Registering installation for php5-extensions-1.6
```

However in /usr/local/www/apache22/data/info.php


```
<?php 
phpinfo();
?>
```

Browse to info.php and PHP shows no information for Curl.

Help


----------



## SirDice (Apr 18, 2012)

No need to rebuild lang/php5-extensions all it does is install ftp/php5-curl as a dependency. So simply install that.


----------



## c00kie (Apr 18, 2012)

SirDice said:
			
		

> No need to rebuild lang/php5-extensions all it does is install ftp/php5-curl as a dependency. So simply install that.



Thanks.

I have a fairly new FreeBSD 9 install. From http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/ports-using.html



> Make sure /usr/ports is empty before you run csup for the first time! If you already have the Ports Collection present, obtained from another source, csup will not prune removed patch files.



Does any of this apply to me? I mean, I'm running `# csup` for the first time. And yes, I have the ports collection present - when I originally installed FreeBSD 9.


----------



## SirDice (Apr 18, 2012)

Unless you have specific reasons not to use it I would suggest using portsnap(8) to update your ports tree.


----------



## c00kie (Apr 18, 2012)

SirDice said:
			
		

> No need to rebuild lang/php5-extensions all it does is install ftp/php5-curl as a dependency. So simply install that.



Hmm.... I just tried someting:

Stood in /usr/ports/ftp/php5-curl
then 
`# make install clean`


```
===> php5-curl-5.3.8 cannot install: doesn't work with PHP version : 52 (Doesn't support PHP 4 52).
*** Error code 1

Stop in /usr/ports/ftp/php5-curl
```

Do I need to update my ports tree?


----------



## SirDice (Apr 18, 2012)

c00kie said:
			
		

> Do I need to update my ports tree?


Yes, PHP has been at 5.3 for quite some time now.


----------



## c00kie (Apr 18, 2012)

SirDice said:
			
		

> Yes, PHP has been at 5.3 for quite some time now.



Thanks.

Now stood in /usr/ports I update my ports tree:
`#  portsnap update` hence my ports tree is up-to-date.

If I `# cd /usr/ports/lang/`
`# # ls`
References to PHP are:


```
php4
php4-extensions
php5
php5-extensions
php52
php52-extensions
```

It appears that PHP53 is not there?


----------



## DutchDaemon (Apr 18, 2012)

[cmd=]rm -f /var/db/portsnap/tag && portsnap fetch extract[/cmd]

After that, you can start running [cmd=]portsnap update[/cmd].


----------



## SirDice (Apr 18, 2012)

From /usr/ports/UPDATING:


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


----------



## c00kie (Apr 19, 2012)

DutchDaemon said:
			
		

> [cmd=]rm -f /var/db/portsnap/tag && portsnap fetch extract[/cmd]
> 
> After that, you can start running [cmd=]portsnap update[/cmd].



Thanks. Does that modify my original portsnap cmd somehow?


----------



## c00kie (Apr 19, 2012)

Thanks for all the help.

I got into a right pickle with dependencies, being unable to deinstall ports that are dependent on others etc... I'm not looking forward to updating ports as existing ones become out of date..

I went for the remove all option, make sure one's port tree is up-to-date and then go from there. I*'*ve now got a current *AMP stack on my server.


----------



## DutchDaemon (Apr 19, 2012)

c00kie said:
			
		

> Thanks. Does that modify my original portsnap cmd somehow?



It ensures you have a totally new and fresh ports tree that is ready for subsequent updating.


----------

