# PHP5 not installing



## wenkep (Jan 28, 2012)

I'm new to freeBSD FreeBSD. I've successfully installed freeBSD FreeBSD 9, but I'm having trouble installing PHP5.  I've tried [CMD=]make config install[/CMD] but the install process says it's out of date.  It prompts me to add 
	
	



```
NO_CHECKSUM
```
 and it gets to the next stage.  Then it quickly fails again saying 
	
	



```
Cannot cd to /usr/port/lang/php5/work/php5.3.8 file/directory does not exist
```
  Does anyone know how to fix this?  Thanks.


----------



## wblock@ (Jan 28, 2012)

Don't override the checksums, they are protecting your system.  Update your ports tree first, then install.


----------



## wenkep3 (Jan 28, 2012)

[CMD=]pkg_version -v[/cmd] says all my ports are up to date.  I'm still getting the error "Make sure the makefile and distinfo (/usr/ports/lang/php5/distinfo) are up to date." Then it says the the override command and exits with error 1.  Any more suggestions?


----------



## Carpetsmoker (Jan 29, 2012)

The download may have been corrupted or interrupted. Use *# make distclean* to remove the downloaded archive and try again.


----------



## wenkep3 (Jan 29, 2012)

Still stopping at the same point.  Heres the full message:

```
Attempting to fetch [url]http://fr.php.net/distributions/php-5.3.9.tar.bz2[/url]
Vulnerability check disabled, database not found.  License check disabled
Found saved configuration file for php5.3.9
SHA256 checksum mismatch for PHP-5.3.9
SHA256 checksum ok for suhsinpatch
Giving up on fetch files PHP-5.3.9.tar.bz2
Make sure makefile and distinfo (/usr/ports/lang/php5/distinfo) files are up to date
```


----------



## wblock@ (Jan 29, 2012)

wenkep3 said:
			
		

> [CMD=]pkg_version -v[/cmd] says all my ports are up to date.



Unless you have updated the ports tree with csup(1) or portsnap(8), then it's comparing to old versions.  PHP is at 5.3.9 in a current version of the ports tree.


----------



## wenkep3 (Jan 29, 2012)

Sorry, I forgot to mention I ran *pkg_version -v* after the *portsnap update*.

```
portsnap fetch
portsnap extract
portsnap update
```

Also, *make distclean* did not work.


----------



## gkontos (Jan 29, 2012)

@wenkep3 ,

How did you update the ports tree?


----------



## wenkep3 (Jan 29, 2012)

I used:


```
portsnap fetch
portsnap extract
portsnap update
```
*Portsnap update* doesn't execute because it says everything is already up to date.


----------



## gkontos (Jan 29, 2012)

That looks good. How about:

[CMD=""]>cat /usr/ports/lang/php5/distinfo[/CMD]


----------



## wenkep3 (Jan 29, 2012)




----------



## gkontos (Jan 29, 2012)

You should be able to build lang/php5 just do a:

[CMD=""]# make clean[/CMD]
[CMD=""]# make config-recursive[/CMD]
[CMD=""]# make install clean[/CMD]


----------



## wenkep3 (Jan 29, 2012)

Heres in make install process:


----------



## gkontos (Jan 29, 2012)

I don't know whats wrong but here is what I get:


```
hp# cd /usr/ports/lang/php5
hp# make
===>  License check disabled, port has not defined LICENSE
===>  Found saved configuration for php5-5.3.3
=> php-5.3.9.tar.bz2 doesn't seem to exist in /usr/ports/distfiles/.
=> Attempting to fetch http://dk.php.net/distributions/php-5.3.9.tar.bz2
php-5.3.9.tar.bz2                              12% of   11 MB   43 kBps 03m57s
```

Just go in /usr/ports/distfiles and do a:

[CMD=""]# fetch http://dk.php.net/distributions/php-5.3.9.tar.bz2[/CMD]

Then repeat the build procedure.


----------



## wenkep3 (Jan 29, 2012)

Still getting the same error.  Heres the commands I used.

`# cd /usr/ports/distfiles`
`# fetch fetch [url]http://dk.php.net/distributions/php-5.3.9.tar.bz2[/url]`
`# cd /usr/ports/lang/php5`
`# make config; make install clean`


----------



## gkontos (Jan 29, 2012)

wenkep3 said:
			
		

> Still getting the same error.  Heres the commands I used.
> `# fetch fetch [url]http://dk.php.net/distributions/php-5.3.9.tar.bz2[/url]`



Could this be a typo?

`# fetch [url]http://dk.php.net/distributions/php-5.3.9.tar.bz2[/url]`

If not, then I can only imagine that there is something wrong with your ports tree. You can always re-extract:

[CMD=""]# portsnap fetch extract[/CMD]


----------



## wenkep3 (Jan 30, 2012)

That was a typo.  The re-extraction didn't work.  I just installed FreeBSD 9, how could my ports already be messed up?  Also, I've tried this on two virtual machines and another computer, one with 32bit and the other 64bit, so I don't think it could be a corrupt file on the cd which transferred to the HDD.


----------



## wenkep3 (Jan 30, 2012)

I just tried the commands again and it worked.  I'm not sure what I did differently but php5.3.9 is installed. Here's any overview of what I did for anyone else who may need this.

`# cd /usr/ports/distfiles`
`# fetch [url]http://us.php.net/distributions/php-5.3.9.tar.bz2[/url]`
`# portsnap fetch extract`
`# cd /usr/ports/lang/php5`
`# make install clean`

Then I verified with:
`# pkg_version -v`
and php5.3.9 was listed.

Thank you gkontos for the help and the quick responses.


----------



## freethread (Jan 30, 2012)

If fetching of tgz port file was interrupted and exit for timeout the tgz file in /usr/port/distfiles is partial. Re-running update (I use portmaster) the process don't re-fetch the tgz and stop with a checksum error. I solved deleting the tgz file.
The source of error: I accidentally disconnected the LAN from internet for a relatively long period while upgrading ports.
It happened on FreeBSD 8.x.


----------

