Click to See Complete Forum and Search --> : php/apache install problem
wurmy
12-14-2000, 10:26 PM
when i try to setup php and apache together (by going into the php directory and running ./configure --with-apache....etc.. - per the NHF and php documentation) at the end of the text i get this:
checking for flex....no
checking for lex.....no
./configure flex command not found
checking for flex....lex
checking yywrap in -ll..no
checking lex output file to root.... ./configure: lex: command not fou nd
configure: error: cannot find output from lex; giving up
---------------
i know flex is installed because i installed it -- i ran ./configure, then make, then make install. but when i type rpm -q flex it says not installed and i have no idea if i'm even typing that right....plus i still keep getting that error when trying to setup php...is there possibly a -dev rpm i'm missing?
(i just installed a whole bunch of them...)
wurmy
Clayboy
12-14-2000, 10:41 PM
try this:
http://freshmeat.net/projects/apachetoolbox/?highlight=apache+tool
might be what you need.
wurmy
12-14-2000, 10:57 PM
did that...ran it...
and ended up at the same error about flex and lex. it said php didn't compile correctly....wtf?
osnap
12-14-2000, 11:19 PM
First of all, if you install from source, doing an rpm query for it will not find it, it wil only find it if you installed it as a rpm.
Secondly, when you installed flex it installed a lib file , meaning a file in either /usr/lib or /usr/local/lib, when you install a file in one of these locations you need to run (as root) ldconfig, it will then update a sort of database that says where all of the libs are.
In short, run ldconfig as root and then try again.
wurmy
12-14-2000, 11:52 PM
i ran ldconfig and still got the flex and lex error....
Sweede
12-15-2000, 12:37 AM
thats because you need lex / flex / yacc !
duh.
osnap
12-15-2000, 12:42 AM
Hmmm....
Do you have lex installed?
All I know is that I have flex and lex already installed and when I compiled PHP and Apache several times, I never got that error.
wurmy
12-15-2000, 12:46 AM
read up top...i've tried to install flex...i run ./configure...then try make but it won't work...says "nothing to be done for 'all'"
i've tried the tar.gz file as well as the rpm for it and none of them seem to be installing it. i know i must be doing something wrong i just don't know what...and i'm almost certain yacc is installed because i was getting an error with something else for that, i downloaded/installed it and the error went away.
wurmy
12-15-2000, 12:47 AM
i don't know where lex is to install it...
osnap
12-15-2000, 12:55 AM
I just looked on my system and lex is linked to flex, so maybe you might try that.
To do so:
cd into wherever flex is installed (either /usr/bin or /usr/local/bin, type 'whereis flex' to find out)
then su to root and issue this command 'ln -s flex lex' (without quotes, of course).
Try again, and see if it does it again.
wurmy
12-15-2000, 01:02 AM
well its in usr/local/bin. i went into that directory and typed ln -s flex lex. it went to the next prompt, no error, nor confirmation. so i ran the apachetoolbox again and it's still there...flex: command not found, lex: command not found...
wurmy
12-15-2000, 01:08 AM
lex is in /usr/local/bin/lex
osnap
12-15-2000, 01:12 AM
I am completely out of ideas. If 'whereis flex' told you that it's in /usr/local/bin then that means it is installed, you've linked lex to it, ran ldconfig and we know that /usr/local/bin is in your path because the 'whereis flex' found it there.
Ooh, just thought of one last thing.
Go into the php-source directory and remove a file called config.cache or run 'make distclean' in the directory and try again, after that I'm out of ideas.
wurmy
12-15-2000, 01:21 AM
i deleted the config.cache file and ran it...still got the error. then i tried running make distclean in the php directory and it told me: "no rule to make target distclean. stop."
osnap
12-15-2000, 01:35 AM
One last resort.
Try linking /usr/local/bin/flex to /usr/bin/flex with the command of 'ln -s /usr/local/bin/flex /usr/bin/flex'
wurmy
12-15-2000, 02:51 PM
osnap.....you absolutely rule. that did it. you just made my day.
(happy) wurmy
osnap
12-15-2000, 03:19 PM
FINALLY!!!!
Hell, I'm glad it worked, because that was the last thing that I could think of.
wurmy
12-15-2000, 03:32 PM
do you know if Active Server Pages work on a linux/apache server, or if they have to be on IIS?
osnap
12-15-2000, 04:06 PM
I don't think so. Besides, why would you want to use asp when you have php?
wurmy
12-15-2000, 04:12 PM
to learn. i'm trying to learn everything i can (i have a friend who's a webmaster at a local hospital and they use asp).
wurmy
12-15-2000, 05:36 PM
ok troubles aren't over yet. i thought i had apache and php working but....
when i bring up index.php on another system with windows and IE it doesn't show the php script (just a little date script). when i bring it up in netscape on my system it brings up a save window as if it wants to save the file...
i have AddType application/x-httpd-php .php in my httpd.conf file....(and i obviously just got done compiling everything).
-- my url is wurmy.dhs.org --
osnap
12-15-2000, 05:42 PM
Try the usual <? phpinfo(); ?> and put that in a script and save it as test.php, don't put anything but that line.
wurmy
12-15-2000, 05:52 PM
that time IE tried to open/save the file as well...and navigator on my machine did the same thing. did i screw something up in apache when i recompiled with php? why would it make my web browsers try to download the pages?
osnap
12-15-2000, 05:52 PM
Well there's nothing wrong with your script, because I downloaded it and tried it on my machine and it works, but test.php isn't working.
Did you restart apache after adding the AddType stuff?
wurmy
12-15-2000, 05:56 PM
yes, several times...
but let me make sure i did it right.
i used apachectl stop and start. do i need to do anything else?
osnap
12-15-2000, 05:59 PM
I just sent you an email with my httpd.conf so look at it and see if there is anything there that you're missing.
Harvey
12-15-2000, 06:03 PM
hey man, what distro were you running?
is it Mandrake7.2 by any chance?
wurmy
12-15-2000, 06:04 PM
yes it is, mandrake 7.2
are you a webdesigner osnap? do you program in php and if so, do you have any sites i could look at?
(still waiting to receive the email with httpd.conf)
osnap
12-15-2000, 06:09 PM
I'm not really a web designer yet. I've just played with php a lot lately and I'm trying to learn it too. I will have a site up soon done in php, but for now I have nothing.
osnap
12-15-2000, 06:16 PM
Did it get there yet? I first sent one to the wurmy.dhs.org one and then one to your other ou.edu address.
wurmy
12-15-2000, 06:19 PM
yes i got it....looked it over. and one BIG difference....i don't have all those Load and AddModules that you have listed. i don't know if i'm supposed to have that many but i for sure don't have ANY. can i send you my file?
osnap
12-15-2000, 06:22 PM
Mine is like that because I compiled PHP as a DSO module, if you compiled it in as the other way then you shouldn't have all of those.
Go ahead and send it to me and I'll look at it.
osnap
12-15-2000, 06:43 PM
O.K. one thing that I noticed is that you have AddType application/x-httpd-php .php and all that in there twice, that might be a problem. Go way down near the bottom at about line 7307 and comment (#) out those two restart and try again.
Also, you don't need the AddType for php3 (line 753&754). Try those and see if it works.
osnap
12-15-2000, 06:47 PM
Also, I don't know if this is normal, but tou have the following lines in there about 50-60 times it seems:
################# Mod Relocate##################
# http://www.tangent.org/mod_relocate
AddHandler relocate .relo
#http://www.server.dom/?_URL=http://www.apachetoolbox.com&key=value
################# Mod Relocate##################
osnap
12-15-2000, 06:50 PM
I just noticed that there is a whole lot that is repeated over and over several times. I don't think that's normal.
osnap
12-15-2000, 07:01 PM
Just thought of something handy.
If you type the command 'httpd -l' then it will list all the compiled-in modules. You might want to look and see if php is even compiled in.
Also, if I were you I wouldn't use that apache toolbox again, because it looks as if it fscked your httpd.conf file all the way to heaven and back.
wurmy
12-15-2000, 07:12 PM
yeah i noticed...i just finished cleaning several *choke* thousand lines of repeated code....bleh. and it still isn't working..about to try what you just posted....
wurmy
12-15-2000, 07:13 PM
what directory do i need to be in to type in httpd -l? i was in the conf direcoty and it said command not found...
osnap
12-15-2000, 07:16 PM
It should be in /usr/local/apache/bin, so try '/usr/local/apache/bin/httpd -l'
osnap
12-15-2000, 07:16 PM
It should be in /usr/local/apache/bin, so try '/usr/local/apache/bin/httpd -l'
wurmy
12-15-2000, 07:24 PM
ding ding ding we have a winner (yet again). the genius has struck. php is nowhere to be found in the list.
osnap
12-15-2000, 07:30 PM
Well that's probably the problem. So get rid of that damn apache toolbox and use this tutorial to the "T" and see if it will work:
With SSL: http://www.linuxguruz.org/z.php?id=32
Without SSL: http://www.linuxguruz.org/z.php?id=31
The one wihout SSL help me set up mine and is the way to do it. This way it will be a DSO module.
wurmy
12-15-2000, 07:44 PM
ok, wish me luck
wurmy
12-15-2000, 09:19 PM
it worked! thanks OSNAP, you saved the day again. heh...by the time i get my system up and running the way i want it i'll pretty much be indebted to you with my life...