1949f [Solved] Apache22 won't start - The FreeBSD Forums
The FreeBSD Forums  

Go Back   The FreeBSD Forums > Server & Networking > Web & Network Services

Web & Network Services Discussion related to network/web services such as apache, bind, sendmail, etc.

Reply
 
Thread Tools Display Modes
  #1  
Old March 22nd, 2012, 15:41
mariourk mariourk is offline
Member
 
Join Date: Nov 2011
Posts: 124
Thanks: 1
Thanked 0 Times in 0 Posts
Default Apache22 won't start

Hi,

I'm having trouble getting Apache22 to work. So far I can say PHP5 seems to cause the trouble. Only I can't figure out what the problem is.

When I start apache, it says all is ok. But when I check with sockstat -4, nothing is listening on port 80.

When I disable this line in httpd.conf, Apache runs fine.
Code:
LoadModule php5_module libexec/apache22/libphp5.so
This is a strange one. When I compile php5 with debug enabled, it also runs fine. That is, apache22 does start, but PHP5 doesn't work.

I tried to set apache's LogLevel to debug, to figure out what goes wrong. But I can't find anything.

Last edited by DutchDaemon; March 23rd, 2012 at 00:26.
Reply With Quote
  #2  
Old March 22nd, 2012, 15:43
SirDice's Avatar
SirDice SirDice is offline
Moderator
 
Join Date: Nov 2008
Location: Rotterdam, Netherlands
Posts: 13,852
Thanks: 48
Thanked 2,061 Times in 1,890 Posts
Default

Have a look in /var/log/httpd-error.log.
__________________
Senior UNIX Engineer at Unix Support Nederland
Experience is something you don't get until just after you need it.
Reply With Quote
  #3  
Old March 22nd, 2012, 15:57
mariourk mariourk is offline
Member
 
Join Date: Nov 2011
Posts: 124
Thanks: 1
Thanked 0 Times in 0 Posts
Default

I did, but that didn't give me much to go on. But now I have PHP5 compiled with debug support, it's coughing up something interresting. Only I don't really understand why it produces these errors

Code:
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20090626-debug/bz2.so' - Cannot open "/usr/local/lib/php/20090626-debug/bz2.so" in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20090626-debug/calendar.so' - Cannot open "/usr/local/lib/php/20090626-debug/calendar.so" in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20090626-debug/ctype.so' - Cannot open "/usr/local/lib/php/20090626-debug/ctype.so" in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20090626-debug/curl.so' - Cannot open "/usr/local/lib/php/20090626-debug/curl.so" in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20090626-debug/dom.so' - Cannot open "/usr/local/lib/php/20090626-debug/dom.so" in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20090626-debug/fileinfo.so' - Cannot open "/usr/local/lib/php/20090626-debug/fileinfo.so" in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20090626-debug/filter.so' - Cannot open "/usr/local/lib/php/20090626-debug/filter.so" in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20090626-debug/gd.so' - Cannot open "/usr/local/lib/php/20090626-debug/gd.so" in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20090626-debug/gettext.so' - Cannot open "/usr/local/lib/php/20090626-debug/gettext.so" in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20090626-debug/gmp.so' - Cannot open "/usr/local/lib/php/20090626-debug/gmp.so" in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20090626-debug/hash.so' - Cannot open "/usr/local/lib/php/20090626-debug/hash.so" in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20090626-debug/iconv.so' - Cannot open "/usr/local/lib/php/20090626-debug/iconv.so" in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20090626-debug/imap.so' - Cannot open "/usr/local/lib/php/20090626-debug/imap.so" in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20090626-debug/json.so' - Cannot open "/usr/local/lib/php/20090626-debug/json.so" in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20090626-debug/ldap.so' - Cannot open "/usr/local/lib/php/20090626-debug/ldap.so" in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20090626-debug/mbstring.so' - Cannot open "/usr/local/lib/php/20090626-debug/mbstring.so" in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20090626-debug/mcrypt.so' - Cannot open "/usr/local/lib/php/20090626-debug/mcrypt.so" in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20090626-debug/mysql.so' - Cannot open "/usr/local/lib/php/20090626-debug/mysql.so" in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20090626-debug/mysqli.so' - Cannot open "/usr/local/lib/php/20090626-debug/mysqli.so" in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20090626-debug/openssl.so' - Cannot open "/usr/local/lib/php/20090626-debug/openssl.so" in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20090626-debug/pdf.so' - Cannot open "/usr/local/lib/php/20090626-debug/pdf.so" in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20090626-debug/pdo.so' - Cannot open "/usr/local/lib/php/20090626-debug/pdo.so" in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20090626-debug/pdo_sqlite.so' - Cannot open "/usr/local/lib/php/20090626-debug/pdo_sqlite.so" in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20090626-debug/pgsql.so' - Cannot open "/usr/local/lib/php/20090626-debug/pgsql.so" in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20090626-debug/phar.so' - Cannot open "/usr/local/lib/php/20090626-debug/phar.so" in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20090626-debug/posix.so' - Cannot open "/usr/local/lib/php/20090626-debug/posix.so" in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20090626-debug/readline.so' - Cannot open "/usr/local/lib/php/20090626-debug/readline.so" in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20090626-debug/recode.so' - Cannot open "/usr/local/lib/php/20090626-debug/recode.so" in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20090626-debug/session.so' - Cannot open "/usr/local/lib/php/20090626-debug/session.so" in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20090626-debug/simplexml.so' - Cannot open "/usr/local/lib/php/20090626-debug/simplexml.so" in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20090626-debug/snmp.so' - Cannot open "/usr/local/lib/php/20090626-debug/snmp.so" in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20090626-debug/soap.so' - Cannot open "/usr/local/lib/php/20090626-debug/soap.so" in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20090626-debug/sockets.so' - Cannot open "/usr/local/lib/php/20090626-debug/sockets.so" in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20090626-debug/sqlite.so' - Cannot open "/usr/local/lib/php/20090626-debug/sqlite.so" in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20090626-debug/sqlite3.so' - Cannot open "/usr/local/lib/php/20090626-debug/sqlite3.so" in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20090626-debug/tokenizer.so' - Cannot open "/usr/local/lib/php/20090626-debug/tokenizer.so" in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20090626-debug/xml.so' - Cannot open "/usr/local/lib/php/20090626-debug/xml.so" in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20090626-debug/xmlreader.so' - Cannot open "/usr/local/lib/php/20090626-debug/xmlreader.so" in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20090626-debug/xmlwriter.so' - Cannot open "/usr/local/lib/php/20090626-debug/xmlwriter.so" in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20090626-debug/zip.so' - Cannot open "/usr/local/lib/php/20090626-debug/zip.so" in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20090626-debug/zlib.so' - Cannot open "/usr/local/lib/php/20090626-debug/zlib.so" in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20090626-debug/apc.so' - Cannot open "/usr/local/lib/php/20090626-debug/apc.so" in Unknown on line 0

Last edited by DutchDaemon; March 23rd, 2012 at 00:26.
Reply With Quote
  #4  
Old March 24th, 2012, 10:09
hockey97 hockey97 is offline
Member
 
Join Date: Jan 2011
Posts: 156
Thanks: 6
Thanked 2 Times in 2 Posts
Default

My suggestion is to uninstall php5 and apache_php5 module.

My question is this: Did you download and install PHP5 and not just Apache's PHP5 module? Apache server uses a PHP5 module but still needs PHP5 installed. Also check to see those data paths and see if those files exist.

From the errors I see... it seems like it's failing to find those files. Therefor either you didn't install PHP5 and just installed Apache's PHP5 module or the files were installed or put somewhere else. The error that it spit out simply says that it can't load the PHP library saying that all files can't be found at such and such place.

I can't actually help you out there. Just giving my opinion/advice based on what you've shown so far.

Hope this helped any.

Last edited by DutchDaemon; March 24th, 2012 at 23:09.
Reply With Quote
  #5  
Old March 26th, 2012, 10:20
mariourk mariourk is offline
Member
 
Join Date: Nov 2011
Posts: 124
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Thanks I'll try uninstalling and reinstalling PHP5.

Quote:
My question is this: Did you download and install PHP5 and not just Apache's PHP5 module?
I installed lang/php5 (with apache module enabled) and lang/php5-extensions. That should be ok, right?

Last edited by DutchDaemon; March 26th, 2012 at 11:46. Reason: [port] tags
Reply With Quote
  #6  
Old April 2nd, 2012, 13:35
mariourk mariourk is offline
Member
 
Join Date: Nov 2011
Posts: 124
Thanks: 1
Thanked 0 Times in 0 Posts
Default

I uninstalled and reinstalled lang/php5 and lang/php5-extensions. Still no luck. What am I doing wrong?

Last edited by DutchDaemon; April 2nd, 2012 at 17:43. Reason: [port] tags
Reply With Quote
  #7  
Old April 2nd, 2012, 13:56
SirDice's Avatar
SirDice SirDice is offline
Moderator
 
Join Date: Nov 2008
Location: Rotterdam, Netherlands
Posts: 13,852
Thanks: 48
Thanked 2,061 Times in 1,890 Posts
Default

Leave PHP out of it, for the time being. Make sure Apache is working correctly, then move on to PHP.

If I remember correctly only two lines need to be added to httpd.conf to get PHP working.
__________________
Senior UNIX Engineer at Unix Support Nederland
Experience is something you don't get until just after you need it.
Reply With Quote
  #8  
Old April 2nd, 2012, 14:01
mariourk mariourk is offline
Member
 
Join Date: Nov 2011
Posts: 124
Thanks: 1
Thanked 0 Times in 0 Posts
Default

I did, when I disable those two lines in httpd.conf, apache runs just fine. As soon as I enable PHP, the trouble begins.

Last edited by DutchDaemon; April 2nd, 2012 at 17:43.
Reply With Quote
  #9  
Old April 5th, 2012, 18:37
Dum_Dum Dum_Dum is offline
Junior Member
 
Join Date: Nov 2008
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I bet PHP extensions are still ending up in:

/usr/local/lib/php/20090626/

instead of:

/usr/local/lib/php/20090626-debug/

even though you have
Code:
WITH_DEBUG=true
in lang/php5?

I'm facing a similar problem - I don't know the answer.

Last edited by DutchDaemon; April 5th, 2012 at 23:48. Reason: Proper formatting: http://forums.freebsd.org/showthread.php?t=8816
Reply With Quote
  #10  
Old April 6th, 2012, 08:53
mariourk mariourk is offline
Member
 
Join Date: Nov 2011
Posts: 124
Thanks: 1
Thanked 0 Times in 0 Posts
Default

I ended up destroying the entire install, So I did a clean reinstall of FreeBSD. I installed named and that went well. Installed Apache22 and that went well too. Installed php5 and ran into the same problem. I simply can't get php5 to work and I can't figure out what's going wrong :'(

During the compilation php5 complained about an old version of devel/pcre. I fixed that with portupgrade devel/pcre. After that php5 would compile fine.

Last edited by DutchDaemon; April 7th, 2012 at 00:49.
Reply With Quote
  #11  
Old April 6th, 2012, 12:53
wblock@'s Avatar
wblock@ wblock@ is offline
Moderator
 
Join Date: Sep 2009
Location: Milky Way galaxy
Posts: 7,851
Thanks: 445
Thanked 1,829 Times in 1,495 Posts
Default

Sounds like you installed a bunch of stuff before updating the ports tree. When the ports tree is installed from the installer, it is what was current when that release came out and should be immediately upgraded.

Also, before installing or upgrading anything, it's important to read /usr/ports/UPDATING. There's a recent note in there about pcre. Just rebuilding that port alone is not enough.
Reply With Quote
  #12  
Old April 11th, 2012, 11:52
mariourk mariourk is offline
Member
 
Join Date: Nov 2011
Posts: 124
Thanks: 1
Thanked 0 Times in 0 Posts
Default

So I did a clean FreeBSD9 install. I installed www/apache22, lang/php5 and lang/php5-extensions. And PHP still doesn't work! However, Apache does start and seems to run fine, even with PHP enabled and no debug compiled. So there is some progress!

I have this in httpd.conf
Code:
LoadModule php5_module        libexec/apache22/libphp5.so
AddType applications/x-http-php .php
AddType applications/x-http-php-source .phps

<IfModule dir_module>
    DirectoryIndex index.html index.php
</IfModule>
The problem is that php files are downloaded as if it where text-files. And phpcode in html-files is ignored and not displayed. I can't find anything strange in the logfiles. libexec/apache22/libphp5.so does exist. Everything seems fine, exept that it doesn't work.

How should I proceed to figure out what's wrong and finally solve this problem?

Edit: When I run this on the commandline php /usr/local/www/apache22/data/index.php, it spits out the expected result (phpinfo() and some echo'd text). So PHP seems to work fine, as does Apache. It's combining the two that's keeping me awake at night

Last edited by DutchDaemon; April 11th, 2012 at 21:24. Reason: Use [port] tags, e.g. [port]www/apache22[/port].
Reply With Quote
  #13  
Old April 11th, 2012, 14:34
Mormegil's Avatar
Mormegil Mormegil is offline
Junior Member
 
Join Date: Jul 2009
Posts: 59
Thanks: 10
Thanked 6 Times in 5 Posts
Default

Code:
applications/x-http-php -> application/x-httpd-php
Reply With Quote
  #14  
Old April 11th, 2012, 15:16
mariourk mariourk is offline
Member
 
Join Date: Nov 2011
Posts: 124
Thanks: 1
Thanked 0 Times in 0 Posts
Default

That's it! You are a lifesaver!

It's always the small errors that cause the mayor problems
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Solved] Apache22 won’t start! arie01 Web & Network Services 12 March 15th, 2012 16:36
[Solved] what does this error mean when i try to start apache22? baronobeefdip Web & Network Services 4 December 1st, 2011 06:22
[Solved] Can't start apache22 folivora Web & Network Services 9 October 18th, 2011 08:04
[Solved] Apache22 will not auto start dpalme Web & Network Services 8 February 23rd, 2011 01:40
Can't start Apache22 Nokobon Web & Network Services 12 June 8th, 2009 19:01


All times are GMT +1. The time now is 07:09.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.
The mark FreeBSD is a registered trademark of The FreeBSD Foundation and is used by The FreeBSD Project with the permission of The FreeBSD Foundation.
Web protection and acceleration provided by CloudFlare
0