# php 5.4 under freebsd 7 - segmentation fault



## saiman (Aug 6, 2012)

Hi all,
I've got problems with 3 php extensions - openssl, ldap and curl. The ports are: 


```
php5-openssl-5.4.5
php5-ldap-5.4.5
php5-curl-5.4.5
```

PHP crash every time with segmentation fault when one of those three is enabled.


```
# php --version
PHP 5.4.5 (cli) (built: Jul 26 2012 11:08:22) 
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologies
Segmentation fault: 11 (core dumped)
```

I was trying to rebuild the every one of those three, even the openssl port but without success - problem still exists. Any suggestions are welcome!

P.S. Below is my freebsd version with generic kernel

```
7.4-STABLE FreeBSD 7.4-STABLE #0: Mon Jul 25 14:44:17 EEST 2011
```


----------



## SirDice (Aug 6, 2012)

Do you have any CFLAGS or similar in /etc/make.conf? If so, remove them.


----------



## saiman (Aug 6, 2012)

SirDice said:
			
		

> Do you have any CFLAGS or similar in /etc/make.conf? If so, remove them.



Below is make.conf


```
# cat /etc/make.conf
WITHOUT_X11=yes
WITHOUT-X11=yes

# Apache suexec configuration options
SUEXEC_DOCROOT=/var/www/vhosts

# GCC compiler optimisations
#CPUTYPE=athlon-xp
#CFLAGS= -O2 -pipe -funroll-loops -ffast-math
#COPTFLAGS= -O2 -pipe -funroll-loops -ffast-math

# added by use.perl 2012-06-08 17:40:48
PERL_VERSION=5.14.2
```

Flags was commented long time ago. Those extensions and the php port itself was build without any flags.


----------



## SirDice (Aug 6, 2012)

saiman said:
			
		

> Flags was commented long time ago. Those extensions and the php port itself was build without any flags.


Ok, that's good. It's the most common cause of strange crashes.


----------



## saiman (Aug 6, 2012)

SirDice said:
			
		

> Ok, that's good. It's the most common cause of strange crashes.



Questions is - what to do? Wait for port update and hope it's because the port or maybe upgrade to last version of FreeBSD 7 or even 8 hopping it happens because the system? Actually the php itself works well, maybe I can "disable" somehow core dumps and just wait to upgrade the port. Or can try to contact the port maintainer but suppose he'll be not able to help me. Actually is there anyone else with FreeBSD 7 and similar problems with those php5 extensions or it's just me?


----------



## SirDice (Aug 6, 2012)

Sorry, I have no idea why it's crashing. Perhaps it's some incompatible combination of options that were turned on? When you rebuild the ports did you choose the default options?


----------



## saiman (Aug 6, 2012)

Will upgrade to 8.3 RELEASE and then will see, hope it's because the system.


----------



## saiman (Aug 7, 2012)

Problem disappeared after upgrade to 8.3 RELEASE. I'm going to rebuild all ports - just in case.


----------



## Victorvanv (Sep 13, 2012)

I'm having the same problem, with the addition of php5-ftp also causing a segfault.
I was just wondering, had you installed openssl from ports on your 7.4? Or were you using stock openssl from 7.4?
I have it installed from ports and I'm wondering if this clashes here, with maybe some ports using stock openssl and some using ports openssl...


----------



## Victorvanv (Sep 13, 2012)

ok well I downgraded openssl from 1.0.1_4 to 1.0.1_2, recompiled everything that depended on it and now everything works again.


----------

