Click to See Complete Forum and Search --> : FreeBSD +apache+mod_php from ports... help?


BSDAdmyn
07-27-2004, 01:42 PM
Hello all, first time on the board, have a little question for everyone. This is not my first time installing php, but my first time having a problem with it, and haven't seen this before so i thought i'd ask you guys for help.
My setup is FreeBSD 5.1, PHP Version 4.3.8,
Apache/1.3.31 (Unix) PHP/4.3.8 mod_ssl/2.8.19 OpenSSL/0.9.7d.

Here is the issue, apache was installed from ports, with mod ssl, works like a charm, mod_php4 was installed via ports, and well, i made the php test page and it's showing me the whole php configuration, and when i try to use a simple little php line of code, something so simple as two lines written, it works just fine, but, I am trying to get php to work, so i can use Acid to check on a snort DB, here is the issue, and where i am now, so it looks like php works, i try to get to acid, initially, it gave me an error about an undefined call to function, i quickly realized, in the /usr/local/etc/ directory, the php.ini was empty, the port didn't put it there, but there was a php.ini-dist and i changed it to my needs, and made it php.ini, now when i go to the /acid directory, instead of the error, the screen is just white, i see the title on the top of the browser for Acid, but it doesn't display anything, what could i be doing wrong???? Any help would be greatly appreciate, like i said, i have done this many times and it's worked great for me, what did i do wrong this time? i added everythring i needed into apache config as well... so i dont know, this is strange. my test page is named index.php and it exposes the whole php config, so php is working, but what isn't?

I'm trying to see if i can figure this problem out like this instead of having to re-install everything from source.

rachel2004
07-27-2004, 02:36 PM
I've built Linux, MySQL, PHP, OpenSSL, and mod_ssl, but I am not a sys admin so I'm not sure what you mean when you say you've installed it from ports.

At any rate, I've used tarballs for each. I can help you (possibly). However, I won't help with any of your IA products.

Please, for me to scan your post, clean it up so I can get to where the part where you are stuck. I seriously mean you no offense on your writing style. I am just trying to skim to where you are stuck so I can make my suggestion to get you on track as quicky as possible.

BSDAdmyn
07-27-2004, 02:59 PM
ok well, let me try to explain this again, I have installed Apache/1.3.31 (Unix) PHP/4.3.9-dev mod_ssl/2.8.19 OpenSSL/0.9.7d on FreeBSD 5.1. I downloaded from snaps.php.net PHP Version 4.3.9-dev. I ran this configure line.

'./configure' '--enable-versioning' '--enable-memory-limit' '--with-layout=GNU' '--disable-all' '--with-regex=php' '--disable-cli' '--with-apxs=/usr/local/sbin/apxs' '--disable-ipv6' '--prefix=/usr/local'


..everything built ok, i proceeded with a make, and a make install, i restarted apache, and bam, PHP 4.3.9-dev is now working.... But this is where my errors come in. From what i can see, PHP is now working, i created a index.php and it includes this
<?php

// Show all information, defaults to INFO_ALL
phpinfo();

// Show just the module information.
// phpinfo(8) yields identical results.
phpinfo(INFO_MODULES);

?>


I go to my webserver, and bam, there is the wole report on php. So far so good right? Here is where i run into problems....

I try to implement, let's just say, squirrelmail, anything php related, when i try to go to that directory, i get this.


Warning: main(../config/config.php): failed to open stream: No such file or directory in /var/www/squirrelmail/functions/global.php on line 16

Fatal error: main(): Failed opening required '../config/config.php' (include_path='.:') in /var/www/squirrelmail/functions/global.php on line 16



It seems like, on the underside, php is working, but for some reason, none of the php scripts i'm trying to use work, and they work for me on every other development machine here, but just this one, what could be wrong?

Is that a little bit clearer for you? I am just trying to write the whole story down as i know some people need a thorough explanation. Thanks again for any help.

rachel2004
07-27-2004, 03:07 PM
Have you verified that the file where your PHP script is expecting to find it in such-and-such directory is actually there and that the directory is readable? It seems from your error message that your required file isn't at the location where the script is expecting to find it.

It doesn't sound like you have an install issue as you've obviouly got PHP serving PHP code. Why did you think it was an install issue, out of curiousity?

BSDAdmyn
07-27-2004, 03:12 PM
well, because things like phpsysinfo, and acid, applications i have many a times before just un tarred, config, and it works, now simply don't seem to do anything.

I'm a little confused as to what is exactly wrong that's why i'm here quite frankly....

Besides that test page i'm looking for something to validate that things are working, i'm a bit fuzzy about this..... trying to deploy acid on this machine to check out the IDS database, but can't get it to work... hmmm



edit:

looking into this more, the snippit of code that is giving me the error is this

/* Deal with user specified session handlers */
if (session_module_name() == "user" )




I am wondering if in this compile i have defined a custom session name? Or am i just off-track on this idea...

rachel2004
07-27-2004, 03:19 PM
Do you need to use the development version of PHP. I noticed you said you are running PHP v.4.3.9-dev.

If you are merely repeating processces for setting up your IDS, then using a development release of anything could impact your build. Use the latest stable tarball or just use v5.0 (unless you have good reason not to).

Please let me know if the required file that your PHP script is expecting to find is in the directory where the script is expecting to find it.

BSDAdmyn
07-27-2004, 03:21 PM
yes it is there, i was just reading the file, that's where i pulled that line of code out from, it's line 49 from that file.....
the whole directory is there, everything is there, it just seems to be bombing out on this and every php application i try to run, what in the hell!

lol.


i made sure to download the latest stable relase, which got me this.

would the dev release affect the way php scripts are handled? I mean, to this extent wher e it will not even work??

rachel2004
07-27-2004, 03:25 PM
Maybe you should solve this like a Window$ sys admin and format/reload, lol.

Seriously, though, it's hard for me to figure out where your problem is as it sounds like you're trying to do muliple things on this server, but I'm only focused on getting your Apacahe web server to parse/serve PHP pages.

Maybe it is worth your time to build this with stable tarballs.

BSDAdmyn
07-27-2004, 03:40 PM
LOL, how about not?

I'm serious though, every single script, even thing slike phpsysinfo which is basiclly unzip, un tar, and go to it's directory, no configuration neccessary.... i get these weird errors

Fatal error: Call to undefined function: preg_split() in /var/www/phpSysInfo-2.1/includes/os/class.FreeBSD.inc.php on line 48


all that stuff exists, it's all there, just won't work?!

hpicken
08-03-2004, 08:58 AM
Hi follks

Just reading with interest the story so far. Sometime it would just be easier to hit the kill switch and go have a bottle of wine.

I'm running FreeBSD 4.7 (still) and have 3 servers running a Apache2/mod_PHP/Mysql config.

Last night I did a cvs ports update and then ran portupgrade and low and behold PHP no longer work properly, (Luckily I didn't do this on the production one). I've spend most of last night and tonight playing with different things.

I ended up loading the /usr/ports/lang/php4 version with configs and all works OK (except that it's telling me I don't have permission to run php from user dirs, but I will look into that later).

So I guess that there is some thing funny with the mod_php directives. When I get time I'll look into it more.

Cheers
Howard