web serving (apache and php)

sollaires

Registered
has anyone tried to serve web pages off of mac os x yet? i have played a little bit with the pre-installed apache and it works fine.

however, i have also gotten my own compiled version of apache to work also. the problem i have is that i cannot get php working with apache. i downloaded and installed it all, but i keep getting "save as" windows when i try to load a php page. anyone else tried this? gotten this to work?

check out my server. tell me if it works.

http://137.22.100.86
or
http://137.22.100.86/sollaires.net/

david hendler
 
i am running darwin and installed php4 recently - had some problems such as you are describing. php seemed to compile fine, but apache would not compile with the php module.

messed with it quite a bit and reworked the ./config settings, also ran 'make clean' instead of just 'make', that seemed to clear up all the previously wacked settings.

in the INSTALL documentation, I followed the "QUICK INSTALL (static)" directions...

I am not sure what finally made it work, but when the error was occuring like yours, I did not have the php module installed correctly under apache; after running 'apache/bin/httpd -l', I would not see mod_php4.c ...
 
hmmm... i will try "make clean"

the only thing is that when i run "httpd -l" mod_php4.c shows up.

another random thing. whenever i try to kill my webserver by using "apachectl stop" it always tells me"stop: httpd (no pid file) not running." is there a surefire way to kill my server and restart it?
 
when you run 'ps -aux | grep httpd' does it show up in the processes?

and I dont know of any other way to stop and start the webserver except with apachectl...

 
How interesting... does anyone know if MySQL compiles under OS X, that is sooo cool... looks like I will have a web development platform at home now. :)

Scott
 
yes. i have gotten mysql to install, though i haven't had time to play with it yet. don't know if all the executables that compile will work afterwards, but the compilation was fine
 
Does anyone have or know where I can get instructions for installing PHP on the OSX PB?

I kinda new to unix and Im not sure what what I should be doing.

I tried to download it from php.net but all I got was a file called "do_download.php". I was expecting to get the file "php-4.02.tar.gz".
I cant seem to get it from the ftp site either. :-(

If I manage to get that file, I then need to compile it, right?

Is it true that there are no compilers in the public beta?

If so can i get a precompiled version from somewhere?

I've also read that It's easier if my version of Apache has been compiled with DSO support. Does the PB install of Apache have this?

As I mentioned Im kinda new to this and want to do some PHP coding and figured having my own local server was the way to go. Feel free to tell me im being stupid if im completly on the wrong track. ;-)


Any help any one can offer is much appreciated.

Thanks, Alex.
 
this is quoted from the macnn board on installing php by FosterBass (http://forums.macnn.com/cgi-bin/Forum34/HTML/000004.html):

"I have PHP4 running now under apache on Mac OS X.
First I installed the developer tools from darwin (as per the MacAddict article at http://www.macaddict.com/content/news/2000/09/13/18709 ).

Then I downloaded the newest source for apache from http://www.apache.org/dist/apache_1.3.12.tar.gz into /tmp

Then I downloaded the newest PHP4 installation from http://www.php.net/downloads.php into /tmp

The directions at http://www.php.net/manual/install.unix.php couldn't be more simple."

I also installed a newer apache release than the one that came with my Darwin system, but the PB is probably more up to date. I dont know if it has the DSO support though. I installed php without it -

as far as the 'do_download.php' page, i dont know what to do except try loading the page again, maybe it was not getting the full path...

hope that helps!
 
oh, one more thing - you can check to see if you have the DSO support by typing 'httpd -l'. you may need to do this by calling the program locally; find it in its 'bin' directory and type './httpd -l'. if one of the modules listed says 'mod_so.c' then you can do the DSO install.
 
How did you compile mySql???

I've installed the darwin development tools with
the new install script (21/09) from macaddict.

Unfortunatly, I had some errors during the mysql
configure process (pid stage).
So, I tried to install the pthreads but the mach/
headers weren't found...

Can you help me?

regards,

Alex.
 
I'm having problems with PHP also. And mod_php4 does show up.

I was trying to do a make clean and I noticed something that make be a problem.

I was following the instructions for a unix installation so I did

make clean
then
make install

and this is what it said.

http://www.pandacreations.com/phperror.tiff

I'm wondering if this is the problem?
 
about mysql:::

i actually did not get it to compile - i keep getting the ps/pid error and have not figured out a way to get the host issue resolved. most of the hostnames did not work because the mysql source didn't understand them. there is a binary download of mac os x mysql, though i haven't had time to play with it too much and have not gotten it to work. so hopefully someone out there with more *nix/bsd experience has figured out how to compile it.

about php,

after several failed installations, i finally got it to work by following the instructions in one of the READMEs. i did a default configuration of apache first (just ./configure with no arguments), then installed the php stuff, then did configured apache again with the arguments

here is the info from the INSTALL doc in the php folder. so do these and hopefully it will work. this requires a new installation of apache. make sure you are logged in or su'ed to root.

$gnuzip < apache_1.3.x.tar.gz | tar xvf -
$cd apache_1.3.x
$./configure
$cd ..

$gunzip < php-4.0.x.tar.gz | tar xvf -
$cd php-4.0.x
$./configure --with-mysql --with-apache=../apache_1.3.x --enable-track-vars
$make
$make install

$cd ../apache_1.3.x
$ ./configure --prefix=/www --activate-module=src/modules/php4/libphp4.a
$ make
$ make install
$ cd ../php-4.0.x
$ cp php.ini-dist /usr/local/lib/php.ini

then edit your http.conf and add (or uncomment if the lines are already there) these

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

after this, i rebooted and things worked for me. check your own files, and your own system, try these out.
 
I have tried everything on this page, checking, re-checking, and installing, compiling.. still can't get PHP4 to work. Any ideas?

 
Originally posted by sollaires
about mysql:::

i actually did not get it to compile - i keep getting the ps/pid error and have not figured out a way to get the host issue resolved. most of the hostnames did not work because the mysql source didn't understand them. there is a binary download of mac os x mysql, though i haven't had time to play with it too much and have not gotten it to work. so hopefully someone out there with more *nix/bsd experience has figured out how to compile it.


Ok. Here is what I have found out so far. You can replace the config.guess and config.sub with the ones that are in /usr/libexec/ (they are both in there) At least on my system, and I have OSX + Dev Tools (these are the real dev tools since I am an ADC member)

that deals with all the hostname problems.

then for the "ps pid" problems. I am not sure why the test doesn't work correctly. But, in the ~mysql/configure script, edit the file and change it to have the following (just search for the # Linux style)


# lame darwin style. not sure why
if $PS p $$ 2> /dev/null | grep sh > /dev/null
then
FIND_PROC="$PS p \$\$PID | grep mysqld > /dev/null"
# Linux style
elif $PS p $$ 2> /dev/null | grep $0 > /dev/null

All I know about this one, is that $$ returns the correct PID, but $0 returns "./configure" which seems right. But in the process list, the PID is listed as just "sh".

Then, be sure to type ./configure --with-named-curses-libs=""

I'll have another way of doing this, but that is the easiest way.

Now, you get the problem with __attribute__. and basically, I haven't fixed the problem yet. I know how to fix it -- it is just 1:15am and I am not going to work on this anymore. The problem is that __attribute__ is not supported by the gcc version that is on the OSX. you need to go through and create somewhere (not sure where yet) a macro that has:

#if defined( __Sometinglike_Darwin__)
#define mysql__attribute(x)
#else
#define mysql__attribute(x) __attribute__(x)
#endif

and then, go through all the code and change all the __attribute__ to mysql_attribute.

I haven't done this yet, so I don't know what the next problems will be. :)

But I got that far.
 
I followed the advice and installed a new apache (+ php). I also quit the default apache. But when I start my installed apache it seems like it uses the first apache ...

/Library/WebServer/ (this is Apple-Apache)

/www/bin/ (this is my Apache)

Should I change some conf. files?
 
make sure you turn "web server" OFF in the system settings. otherwise, the preinstalled apache will start up. when i boot my system up, i let it load, then immediately drop into a terminal and run /www/bin/apachectl start.

i am sure there is someway to make the installed apache start while booting, but this is beyond my knowledge. anyone else played with this?
 
Yes, I do exactly as U ...

But it seems like "my" apache uses the other apaches conf. files and DocumentRoots ... hmmm strange

 
Back
Top