# PHP5.4 doesn't compile apache module



## mariourk (May 29, 2012)

I just uninstalled all php52 packages and installed php5 (really php54) after that. So far so good. Only now I see the apache module is not compiled and installed. And I can't figure out why. I did enable the option in lang/php5.

Any ideas why and how to fix it?


----------



## DutchDaemon (May 29, 2012)

Check whether [cmd=]cat /var/db/ports/php5/options[/cmd] actually has 
	
	



```
WITH_APACHE=true
```
 If not, run [cmd=]cd /usr/ports/lang/php5 && make config[/cmd] and enable it. Then reinstall.


----------



## mariourk (May 29, 2012)

It says:

```
OPTIONS_FILE_SET+=APACHE
```

When I do [cmd=]cd /usr/ports/lang/php5 && make config[/cmd], the option is enabled. But when I compile and install php5, libphp5.so isn't there.

[cmd=]ls -al /usr/local/libexec/apache22/ | grep php[/cmd] shows up empty. Apache also gives an error when I try to start it and complains it can't find /usr/local/libexec/apache22/libphp5.so

I really don't understand this. :\


----------



## mariourk (May 29, 2012)

When I install php5-extensions, most of the selected packages aren't installed. For some reason, ports seems to totally ignore the config files of those ports.


----------



## DutchDaemon (May 29, 2012)

> ```
> OPTIONS_FILE_SET+=APACHE
> ```



This doesn't look like valid syntax for ports options files. Please remove /var/db/ports/php5/options and run [cmd=]cd /usr/ports/lang/php5 && make config[/cmd] again. Then look at /var/db/ports/php5/options again. If the weird 
	
	



```
OPTIONS_FILE_SET+=APACHE
```
 type of output shows up again, my guess is you have a damaged ports tree (Mk structure) that needs to be installed from scratch. This would also mean removing all of the options files and recompiling installed ports again.


----------



## mariourk (May 29, 2012)

I'm afraid that is the case

I'm new to FreeBSD. How do I fix this and what does this mean for me

Edit: I tried to remove /var/db/ports/php5/options. But when I ran make config again, it still loooked like this:

```
# This file is auto-generated by 'make config'.
# Options for php5-5.4.3
_OPTIONS_READ=php5-5.4.3
_FILE_COMPLETE_OPTIONS_LIST=AP2FILTER APACHE CGI CLI DEBUG DTRACE EMBED FPM IPV6 LINKTHR MAILHEAD
OPTIONS_FILE_UNSET+=AP2FILTER
OPTIONS_FILE_SET+=APACHE
OPTIONS_FILE_SET+=CGI
OPTIONS_FILE_SET+=CLI
OPTIONS_FILE_UNSET+=DEBUG
OPTIONS_FILE_UNSET+=DTRACE
OPTIONS_FILE_UNSET+=EMBED
OPTIONS_FILE_UNSET+=FPM
OPTIONS_FILE_SET+=IPV6
OPTIONS_FILE_SET+=LINKTHR
OPTIONS_FILE_UNSET+=MAILHEAD
```


----------



## DutchDaemon (May 29, 2012)

Get a whole new ports tree:
[cmd=]rm /var/db/portsnap/tag && portsnap fetch extract[/cmd]

Check whether the files mentioned in http://www.freebsd.org/cgi/getmsg.cgi?fetch=420266+0+current/cvs-ports have the right versions. If not, wait 30 minutes and try again. Don't proceed until you have the fixed versions!

Quick fix (well, a *try* anyway):

[cmd=]cd /var/db/ports && grep -rl OPTIONS_FILE_SET[/cmd]

Make a list of all ports that show up there, and remove all of the options files that are mentioned in the output. Reinstall those ports.


----------



## mariourk (May 29, 2012)

I updated posts and it worked after that. PHP54 is working! 


```
portsnap fetch update
pkgdb -F
portsdb -Uu
```

portsdb -Uu still gives an error though:

```
Updating the ports index ... Generating INDEX.tmp - please wait.."/usr/ports/Mk/bsd.options.mk", line 154: warning: Missing closing parenthesis for defined()
"/usr/ports/Mk/bsd.options.mk", line 154: Malformed conditional (!defined(WITH_"ISO-8859-2 fonts support") && !defined(WITHOUT_"ISO-8859-2 fonts support"))
"/usr/ports/Mk/bsd.port.mk", line 6428: if-less endif
"/usr/ports/Mk/bsd.options.mk", line 150: warning: Missing closing parenthesis for defined()
"/usr/ports/Mk/bsd.options.mk", line 150: Malformed conditional (!defined(WITH_"ISO-8859-2 fonts support") && !defined(WITHOUT_"ISO-8859-2 fonts support"))
"/usr/ports/Mk/bsd.port.mk", line 6428: if-less endif
make: fatal errors encountered -- cannot continue
===> databases/rrdtool10 failed
*** Error code 1

failed to generate INDEX!
portsdb: index generation error
```


----------



## sub1 (May 29, 2012)

Hello all,

I got the same issue. No more php5 module after upgrade.
I tried to update my port tree, clean options for this port and still no luck..

Finally, problem was solved for me by clearing ccache data before rebuilding php.


```
ccache -c
cd /usr/ports/lang/php5
make deinstall reinstall clean
```

Then php5 module compiled.


----------



## Anonymous (Mar 5, 2013)

DutchDaemon said:
			
		

> This doesn't look like valid syntax for ports options files.



Is the format for the options file documented somewhere?  I did a quick look at the porter's handbook but didn't see anything relevant.

I ask because I'm having the same no-Apache22-module problem (among others related to the general loss of support for FreeBSD).  Looking in the options files, I saw the same syntax that looked broken to you, so I deleted the whole /var/db/ports/ subtree, did a fresh 
	
	



```
portsnap fetch update
```
 and started to rebuild, beginning with Apache22.  But the same syntax appears to have recurred: 
	
	



```
# This file is auto-generated by 'make config'.
# Options for apache22-2.2.24
_OPTIONS_READ=apache22-2.2.24
_FILE_COMPLETE_OPTIONS_LIST= AUTH_BASIC AUTH_DIGEST AUTHN_ALIAS AUTHN_ANON AUTHN_DBD AUTHN_DBM AUTHN_DEFAULT AUTHN_FILE AUTHZ_DBM AUTHZ_DEFAULT AUTHZ_GROUPFILE AUTHZ_HOST AUTHZ_OWNER AUTHZ_USER AUTHNZ_LDAP LDAP DBD CACHE DISK_CACHE FILE_CACHE MEM_CACHE DAV DAV_FS DAV_LOCK ACTIONS ALIAS ASIS AUTOINDEX CERN_META CGI CGID CHARSET_LITE DEFLATE DIR DUMPIO ENV EXPIRES HEADERS IMAGEMAP INCLUDE INFO LOG_CONFIG LOGIO MIME MIME_MAGIC NEGOTIATION REWRITE SETENVIF SPELING STATUS UNIQUE_ID USERDIR USERTRACK VHOST_ALIAS FILTER SUBSTITUTE VERSION SSL SUEXEC SUEXEC_RSRCLIMIT SUEXEC_USERDIR REQTIMEOUT PROXY IPV4_MAPPED BUCKETEER CASE_FILTER CASE_FILTER_IN EXT_FILTER LOG_FORENSIC OPTIONAL_HOOK_EXPORT OPTIONAL_HOOK_IMPORT OPTIONAL_FN_IMPORT OPTIONAL_FN_EXPORT PROXY_AJP PROXY_BALANCER PROXY_CONNECT PROXY_FTP PROXY_HTTP PROXY_SCGI
OPTIONS_FILE_SET+=AUTH_BASIC
OPTIONS_FILE_SET+=AUTH_DIGEST
OPTIONS_FILE_SET+=AUTHN_ALIAS
OPTIONS_FILE_SET+=AUTHN_ANON
OPTIONS_FILE_UNSET+=AUTHN_DBD
OPTIONS_FILE_SET+=AUTHN_DBM
OPTIONS_FILE_SET+=AUTHN_DEFAULT
OPTIONS_FILE_SET+=AUTHN_FILE
OPTIONS_FILE_SET+=AUTHZ_DBM
OPTIONS_FILE_SET+=AUTHZ_DEFAULT
OPTIONS_FILE_SET+=AUTHZ_GROUPFILE
OPTIONS_FILE_SET+=AUTHZ_HOST
OPTIONS_FILE_SET+=AUTHZ_OWNER
OPTIONS_FILE_SET+=AUTHZ_USER
OPTIONS_FILE_UNSET+=AUTHNZ_LDAP
OPTIONS_FILE_UNSET+=LDAP
OPTIONS_FILE_UNSET+=DBD
OPTIONS_FILE_SET+=CACHE
OPTIONS_FILE_SET+=DISK_CACHE
OPTIONS_FILE_SET+=FILE_CACHE
OPTIONS_FILE_UNSET+=MEM_CACHE
OPTIONS_FILE_SET+=DAV
OPTIONS_FILE_SET+=DAV_FS
OPTIONS_FILE_UNSET+=DAV_LOCK
OPTIONS_FILE_SET+=ACTIONS
OPTIONS_FILE_SET+=ALIAS
OPTIONS_FILE_SET+=ASIS
OPTIONS_FILE_SET+=AUTOINDEX
OPTIONS_FILE_SET+=CERN_META
OPTIONS_FILE_SET+=CGI
OPTIONS_FILE_UNSET+=CGID
OPTIONS_FILE_SET+=CHARSET_LITE
OPTIONS_FILE_SET+=DEFLATE
OPTIONS_FILE_SET+=DIR
OPTIONS_FILE_SET+=DUMPIO
OPTIONS_FILE_SET+=ENV
OPTIONS_FILE_SET+=EXPIRES
OPTIONS_FILE_SET+=HEADERS
OPTIONS_FILE_SET+=IMAGEMAP
OPTIONS_FILE_SET+=INCLUDE
OPTIONS_FILE_SET+=INFO
OPTIONS_FILE_SET+=LOG_CONFIG
OPTIONS_FILE_SET+=LOGIO
OPTIONS_FILE_SET+=MIME
OPTIONS_FILE_SET+=MIME_MAGIC
OPTIONS_FILE_SET+=NEGOTIATION
OPTIONS_FILE_SET+=REWRITE
OPTIONS_FILE_SET+=SETENVIF
OPTIONS_FILE_SET+=SPELING
OPTIONS_FILE_SET+=STATUS
OPTIONS_FILE_SET+=UNIQUE_ID
OPTIONS_FILE_SET+=USERDIR
OPTIONS_FILE_SET+=USERTRACK
OPTIONS_FILE_SET+=VHOST_ALIAS
OPTIONS_FILE_SET+=FILTER
OPTIONS_FILE_UNSET+=SUBSTITUTE
OPTIONS_FILE_SET+=VERSION
OPTIONS_FILE_SET+=SSL
OPTIONS_FILE_UNSET+=SUEXEC
OPTIONS_FILE_UNSET+=SUEXEC_RSRCLIMIT
OPTIONS_FILE_UNSET+=SUEXEC_USERDIR
OPTIONS_FILE_SET+=REQTIMEOUT
OPTIONS_FILE_UNSET+=PROXY
OPTIONS_FILE_UNSET+=IPV4_MAPPED
OPTIONS_FILE_UNSET+=BUCKETEER
OPTIONS_FILE_UNSET+=CASE_FILTER
OPTIONS_FILE_UNSET+=CASE_FILTER_IN
OPTIONS_FILE_UNSET+=EXT_FILTER
OPTIONS_FILE_UNSET+=LOG_FORENSIC
OPTIONS_FILE_UNSET+=OPTIONAL_HOOK_EXPORT
OPTIONS_FILE_UNSET+=OPTIONAL_HOOK_IMPORT
OPTIONS_FILE_UNSET+=OPTIONAL_FN_IMPORT
OPTIONS_FILE_UNSET+=OPTIONAL_FN_EXPORT
OPTIONS_FILE_UNSET+=PROXY_AJP
OPTIONS_FILE_UNSET+=PROXY_BALANCER
OPTIONS_FILE_UNSET+=PROXY_CONNECT
OPTIONS_FILE_UNSET+=PROXY_FTP
OPTIONS_FILE_UNSET+=PROXY_HTTP
OPTIONS_FILE_UNSET+=PROXY_SCGI
```

Is it possible that this is the new syntax?  If it's not, then this could be quite a large problem.

edit:  I forgot to mention that I eliminated stale ccache data and 
	
	



```
config-recursive
```
 as possible problems.


----------



## DutchDaemon (Mar 5, 2013)

That is the new syntax, yes. The contents of /usr/ports/Mk/bsd.port.mk and /usr/ports/Mk/bsd.options.mk may shed some light.


----------

