# Help with apache22 error



## Tnnuyt (Jan 22, 2013)

Good night! How can I solve this problem?


```
tnnuyt# /usr/local/etc/rc.d/apache22 restart
Performing sanity check on apache22 configuration:
httpd: Syntax error on line 106 of /usr/local/etc/apache22/httpd.conf: Cannot load /usr/local/libexec/apache22/libphp5.so into server: Cannot open "/usr/local/libexec/apache22/libphp5.so"
tnnuyt#
```


----------



## cpm@ (Jan 23, 2013)

You didn't see this thread?


----------



## ericmacmini (Jan 23, 2013)

```
cd /usr/ports/lang/php5
make config
```

And check in the options that Apache Module is selected.


----------



## Tnnuyt (Jan 24, 2013)

ericmacmini said:
			
		

> ```
> cd /usr/ports/lang/php5
> make config
> ```
> ...





I did it select the Apache


```
â”‚ â”‚ [X] CLI        Build CLI version                               â”‚ â”‚
     â”‚ â”‚ [X] CGI        Build CGI version                               â”‚ â”‚
     â”‚ â”‚ [ ] FPM        Build FPM version                               â”‚ â”‚
     â”‚ â”‚ [X] APACHE     Build Apache module                             â”‚ â”‚
     â”‚ â”‚ [ ] AP2FILTER  Use Apache 2.x filter interface (experimental)  â”‚ â”‚
     â”‚ â”‚ [ ] EMBED      Build embedded library                          â”‚ â”‚
     â”‚ â”‚ [ ] DEBUG      Enable debug                                    â”‚ â”‚
     â”‚ â”‚ [ ] DTRACE     Enable DTrace support                           â”‚ â”‚
     â”‚ â”‚ [X] IPV6       Enable ipv6 support                             â”‚ â”‚
     â”‚ â”‚ [ ] MAILHEAD   Enable mail header patch                        â”‚ â”‚
     â”‚ â”‚ [X] LINKTHR    Link thread lib (for threaded extensions)       â”‚ â”‚
```


----------



## cpm@ (Jan 24, 2013)

Reinstall lang/php5 as following:

`# cd /usr/ports/lang/php5 && make deinstall clean reinstall clean`

Check you have enabled and isn't duplicated this line in httpd.conf

```
LoadModule php5_module        libexec/apache22/libphp5.so
```


----------



## Tnnuyt (Jan 24, 2013)

cpu82 said:
			
		

> Reinstall lang/php5 as following:
> 
> `# cd /usr/ports/lang/php5 && make deinstall clean reinstall clean`
> 
> ...




rather not have 2 times the same line, already tried to do it again and always the same error


----------



## cpm@ (Jan 24, 2013)

Check libphp5.so is located in /usr/libexec/apache22/

`# ls /usr/libexec/apache22/libphp5.so`

Optionally, you can add to /etc/make.conf. Read /usr/ports/Mk/bsd.apache.mk for details.

```
APACHE_PORT= www/apache22
```

Reinstall again www/apache22.


----------



## Tnnuyt (Jan 25, 2013)

Hello good night! Already installed FreeBSD 8.2 from new, mysql, apache22, lang/php5, lang/php5-extentions ... and continue with the same error ...


```
#new-host-2# ls: /usr/libexec/apache22/libphp5.so: No such file or directory
ls:: Too many arguments.
```
Not there -----> libexec/apache22/libphp5.so


----------



## cpm@ (Jan 25, 2013)

Please, show your /etc/make.conf

Use find(1) in the work directory of /usr/ports/lang/php5 to check if library exist.

```
# cd /usr/ports/lang/php5
# make
# find . -name libphp5.so
```


----------



## Tnnuyt (Jan 25, 2013)

not there ---> /etc/make.conf
I found here -> /usr/share/examples/etc/make.conf


----------



## cpm@ (Jan 25, 2013)

Tnnuyt said:
			
		

> hello good night! already installed FreeBSD 8.2 from new, mysql, www/apache22, lang/php5, lang/php5-extensions ... and continue with the same error ...



Upgrade to FreeBSD 8.3, 8.2 is EoL (End-of-Life) since 31 July 2012. Read more about FreeBSD security.



			
				Tnnuyt said:
			
		

> not there ---> /etc/make.conf
> I found here -> /usr/share/examples/etc/make.conf



Note that make.conf(5) stores system-wide build settings that apply each time you run make(1). Used as reference /usr/share/examples/etc/make.conf, but your working copy should be placed in /etc. Copy example:

`# cp /usr/share/examples/etc/make.conf /etc`


----------



## wblock@ (Jan 25, 2013)

The library will not exist until the port is installed.

Tnnuyt, you may be having punctuation problems.  Look at post #8.  That did not work because there was an extra colon character after ls.

I don't think you need /etc/make.conf, more likely you have just not properly built the PHP port.


----------



## Tnnuyt (Jan 25, 2013)

Hello! Already tried with FreeBSD 9.0 64bits, and still the same error.
I'm following this tutorial http://caffetine.org/freebsd-amp.php


----------



## cpm@ (Jan 25, 2013)

Please, submit a PR to freebsd-apache mailing list to get help. And remember, is free! :e


----------



## wblock@ (Jan 25, 2013)

That is very old and may be outdated.  It also says to use

```
make BUILD_OPTIMIZED=yes BUILD_STATIC=yes
```
when building MySQL.  Don't do that.  Or rather, don't do that unless you can explain why it can be a problem.


----------



## Tnnuyt (Jan 25, 2013)

wblock@ said:
			
		

> That is very old and may be outdated.  It also says to use
> 
> ```
> make BUILD_OPTIMIZED=yes BUILD_STATIC=yes
> ...



I have not used this tutorial to install mysql

I tried to use this tutorial http://www.cyberciti.biz/faq/freebsd-apache22-fastcgi-php-configuration/
[CMD="Forbidden You don't have permission to access / on this server."][/CMD]


----------



## Tnnuyt (Jan 25, 2013)

but I have another error Forbidden

Forbidden

You don't have permission to access / on this server.


----------



## cpm@ (Jan 25, 2013)

Tnnuyt said:
			
		

> but I have another error Forbidden
> 
> Forbidden
> 
> You don't have permission to access / on this server.



Check out pkg-message.mod, it appears when successfully install lang/php5:

`# cat /usr/ports/lang/php5/pkg-message.mod`

You need add these lines to your httpd.conf

```
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
```

EDIT

Please, show your /var/log/httpd-error.log. For long outputs uses some service like pastebin.com and post here the URL.


----------



## Tnnuyt (Jan 25, 2013)

I added these lines.

See my httpd.conf.




PS:there is some kind xampp service for FreeBSD?

http://pastebin.com/9zuvJ8BS

http://pastebin.com/fVi6hnZz


----------



## cpm@ (Jan 26, 2013)

To solve '*PHP Warning:  phpinfo(): It is not safe to rely on the system's timezone settings*', add the date.timezone directive in your php.ini as following e.g.: 

```
date.timezone = America/Vancouver
```
Or, you can also do it this way

```
date_default_timezone_set('America/Vancouver');
```

You can set it to other timezone. See List of Supported Timezones.

To don't see the warning '*[warn] Init: Session Cache is not configured [hint: SSLSessionCache]*', make sure that your /usr/local/etc/apache22/extra/httpd-ssl.conf gets loaded before your virtual host configuration file and contains a line that looks like:

```
SSLSessionCache        shmcb:/some/example/path/ssl_scache(512000)
```

Verify the OPENSSL is enabled in lang/php5-extensions using steps below:

`# cd /usr/ports/lang/php5-extensions && make config && make deinstall clean reinstall clean`

Edit your /etc/hosts, and add your hostname:

```
127.0.0.1		localhost localhost.my.domain [B]new.host.name[/B]
```

hostname(1) must be the same you putting in /etc/rc.conf:

```
hostname="new.host.name"
```

After taking a look at your configuration file, edit your httpd.conf:154 and do this change (uncomment & add):

```
ServerName new.host.name:80
```

Then you should restart apache:

`# /usr/local/sbin/apachectl restart`

PS second link shows 'Unknown Paste ID!', again copy the contents of your httpd.conf


----------



## Tnnuyt (Jan 26, 2013)

I can not resolve this error! already searched in google, already did 20 times more d installation etc etc, do not know what I'm doing wrong, but it's always wrong, and I do not read my php, already put the time in php.ini  !! know some tutorial?

http://pastebin.com/0BRZPQJX
httpd.conf


----------



## cpm@ (Jan 26, 2013)

Tnnuyt said:
			
		

> I can not resolve this error! already searched in google, already did 20 times more d installation etc etc, do not know what I'm doing wrong, but it's always wrong, and I do not read my php, already put the time in php.ini  !! know some tutorial?
> 
> http://pastebin.com/0BRZPQJX
> httpd.conf



Don't need to use XAMPP, when every part is fully supported via ports. Follow one of the many *HOWTO* guides for setting up Apache/PHP/MySQL for FreeBSD.

*References*:

[1] FreeBSD Handbook Chapter 30 Network Servers.
[2] Installing Apache Web Server on FreeBSD.
[3] How to Install Apache, MySQL, PHP, and phpMyAdmin on FreeBSD.
[4] How to build a FreeBSD server.


----------



## Tnnuyt (Jan 26, 2013)

good night! Thank you for  help .... I solved my problem with this tutorial
http://www.iceflatline.com/2011/11/how-to-install-apache-mysql-php-and-phpmyadmin-on-freebsd/

I can use a DNS created by me in freebsd "tnnuyt.lp" or must use the no-ip?


----------



## cpm@ (Jan 26, 2013)

Tnnuyt said:
			
		

> good night! Thank you for  help .... I solved my problem with this tutorial
> http://www.iceflatline.com/2011/11/how-to-install-apache-mysql-php-and-phpmyadmin-on-freebsd/
> 
> I can use a DNS created by me in freebsd "tnnuyt.lp" or must use the no-ip?



Install a DDNS client if the server will use a dynamic IP address and DDNS service, dns/noip DDNS client.

```
# cd /usr/ports/dns/noip
# make install clean
```

Follow instructions to create /usr/local/etc/no-ip2.conf and enable DDNS client by editing /etc/rc.conf

PS: I edited comment#20, please review it.


----------



## Tnnuyt (Jan 26, 2013)

Thanks problem solved


----------



## cpm@ (Jan 26, 2013)

Tnnuyt said:
			
		

> Thanks problem solved



Please, mark thread as solved


----------



## Tnnuyt (Jan 26, 2013)

how to do this?


----------



## cpm@ (Jan 26, 2013)

Tnnuyt said:
			
		

> how to do this?



See comment#26 above :OOO


> Edit the first post in the thread, go to advanced mode. There's a pulldown menu to the left of the title. Now mark this thread solved!


PS: Edit Tags -> Uncheck your tag [solved] to remove it from this thread. Please, read Posting and Editing in the FreeBSD Forums I: proper formatting.


----------

