Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.
AZGINBOGA said:
I created a file calles test.php which containes <? phpinfo(): ?> and dropped it in /library/apache2/conf but still does not work...I dont know what Im doing wrong...

seriously... why didn't anyone catch this? semicolon, not colon.

Code:
<?php phpinfo(); ?>
 
mnkeybsness said:
seriously... why didn't anyone catch this? semicolon, not colon.

Code:
<?php phpinfo(); ?>

He hasn't got that far, yet ;) And I think someone pointed this out in his other thread.

Although it did get quiet in here, perhaps its fixed???
 
I dropped the test.php file in library/apache2/htdocs again I haver never worked with apache nor php, just trying to set up the environmet for training...what's the next step?
 
This is what I have in test.php file

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 TRANSITIONAL//EN">
<html>

<head>
<title>Testing PHP</title>
</head>
<body>
<?php
phpinfo();
?>

</body>
</html>
 
My 2 cents - from having zero knowledge to running a website...

Ok - I don't know if there's a specific reason that you're using apache 2, but if there's not why don't you remove the stuff you've installed and try this approach (the one I used to set up apache/php/mysql on my server).

I'm going to assume that you have 10.3, and are not using the server version.

Most of the software you want to run generally needs to be compiled to 'work'. I don't know where you got the packages, but there are only a couple of places you can get "pre-packaged" php and mysql. Apache 1.3 already lives on your system, along with other goodies you'll need for running a server like a mail system (MTA - SMTP) called Postfix, a text editor called Pico (easy) or Vim (advanced). You'll need to know how to use the command line or terminal, which is Bash if you're on 10.3. All the config files for these servers are text based, and are in locations hidden to the Finder (although BBEdit can 'see' hidden files, one of the best editors in the world if you're serious).

Setting up these server packages is not just a piece of cake (unless you have OS X 10.3 server I think...). I was learning from scratch, and fumbled my way through. However, if you read, and google you'll learn heaps and (probably) perserver :). When reading about how to set things up always remember that something written for Linux or BSD will also most likely apply to OS X as well.

OK - first step. Marc Liyanage has done most of the hard work for you, by packaging up PHP and MySQl (or, he may not do the packaging anymore, but he does have excellent instructions on how to set up your system and links on where to get the packages). Go to his home-page http://www.entropy.ch/software/macosx/ . Now, the packages you want will probably only work with certain versions of Apache. They'll will probably also depend on a specific complied version - namely the on that ships with OS X 10.3, which is an Apache 1.3 - NOT 2. Again, if you really need to use 2, then you're probably on your own. Apache 2 is not really better than 1.3 in any way, and in fact they're both being actively developed at the same time. Apple also releases security updates to the standard installed Apache with the software updates - it's a much easier way to stay secure than downloading and compiling your own patches.

That's all I've got time for at the moment...start with Marc's page and go from there.

a.

(late comment - Marc does link to the PHP 5 package for Apache 2 on his page. Make sure you have that one, and not the one for Apache 1.3)
 
mim said:
Ok - I don't know if there's a specific reason that you're using apache 2, but if there's not why don't you remove the stuff you've installed and try this approach (the one I used to set up apache/php/mysql on my server).

Its in his other thread. Some crazy instructor wants him to use PHP 5/Apache 2.
 
Another thought too -

If you start up Apache my command line, it will tell you any errors it has when loading modules (the PHP module for example).

In the terminal type sudo httpd stop to stop Apache (the http daemon). You'll have to type in your password when it asks.
The type sudo httpd start. It'll tell you if anything is going wrong.

One note though - httpd is the Apache 1.3 with OS X. I don't know if Apache 2 re-binds(?) that command to itself, or if it goes by a different name. Someone else here will probably know.
 
kingjr3 said:
View source of this page in your browser, what does it look like?

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 TRANSITIONAL//EN">
<html>

<head>
<title>Testing PHP</title>
</head>
<body>
<?php
phpinfo();
?>

</body>
</html>
 
Seems the php.so isn't doing its job.

Did you get any errors while starting apache? These are important to pay attention to.

Check to see if that /Library/Apache2/libexec/libphp5.so actually exists.

Seems to me that libphp5.so should be located in /Library/Apache2/modules

Basically see if you can find where libphp.so was installed.
 
kingjr3 said:
Seems the php.so isn't doing its job.

Did you get any errors while starting apache? These are important to pay attention to.

Check to see if that /Library/Apache2/libexec/libphp5.so actually exists.

Seems to me that libphp5.so should be located in /Library/Apache2/modules

Basically see if you can find where libphp.so was installed.

Library/Apache2/lib existis not libexec

and I did not find libphp6.so in /library/Apache2/moodules
 
AZGINBOGA said:
Library/Apache2/lib existis not libexec

and I did not find libphp6.so in /library/Apache2/moodules

I'm wondering if you should try reinstalling the PHP5 module

This would be a lot easier if I could just hop into your machine :)
 
kingjr3 said:
I'm wondering if you should try reinstalling the PHP5 module

This would be a lot easier if I could just hop into your machine :)

Let's do it, I really need this thing running by monday,so I really need help...so where should try reinstaling the PHP5 module?
 
apache2 is fine, I got that running, is there anyway I can install the php5 w/out using terminal? I suck at using terminal...and this is the 3rd time I have been reinstalling php5 :(
 
The problem is, is that typically a particular installation/package of PHP or mysql will only work with particular package of Apache. If you compile them both, or use a package put together by someone with 'the recipe' you'll get it to work.

What we don't know is where you got your Apache or PHP packages. If you work through the guide, it tells you exactly what to type, and when. It's probably a good chance to get to know the terminal anyway. If you're doing a course and using Apache/PHP/MySql you're going to HAVE to use the terminal at some stage. Especially with MySql!

[edit - also we know you got apache working...great. The problem seems to be that the PHP module isn't loading. That could be for any number of reasons. You need to get the 'correct' version of PHP5. The link above overcomes this by telling you how to compile it specifically for the latest version of Apache. You also need to edit (manually) the Apache config files so that the PHP module will load. Think of the PHP module as a part Apache that you have to add to the base program. It's simply not a case of throwing the two together and turning it on. The alternative to doing it the hard way - like this - is to spend the cash and buy 10.3 Server, which has it already to go and you just have to click the pretty widgets to make it run.]
 
Is there anyway we can work this out together over the phone or on aim? If so you can email me your aim name or phone number at rapidrabbit@gmail.com....I really need to get this things running on my mac, I have been trying since last wed, Im going nuts! Thanks for your time...
 
DarwinPorts (which you should probably use) says this about PHP5, Apache2, and MySQL4.

php5 has library dependencies on:
libiconv
expat
libxml2
gettext
zlib
tiff
apache

apache2 has library dependencies on:
apr
apr-util
expat

mysql4 has no dependencies

Basically...my advice is to use DarwinPorts. Its as close to 'user-friendly' as you are going to get with a package manager. It also enables you to do all of this testing and such outside of your main system. Almost everything resides in /opt. This is good for when you screw up really badly. Protecting your system is a must, especially when you don't know what you are doing...which is somewhat apparent. Read through the documentation for DarwinPorts for instructions on installation, use, etc, and then start making it work.

If you are going to be doing these kinds of things, you'll have to get used to a few things. First of all, learning things for yourself is much quicker than asking a forum to do it for you...plus you actually learn something (BONUS). Second, get to know your commandline...there is no way around it. Pick up a book to get your started; I recommend Mac OS X Unleashed. I probably gleaned more understanding about UNIX from that book than a good bit of Linux experience gained blindly. Lastly... try to realize that doing yourself helps you learn how things work, while asking things to be done for you simply sets you up for the next time something breaks or needs to be installed. There is no reason you should be letting someone into your machine.
 
mim said:
Step by step instructions for installing Apache 2 and PHP 5 here - http://www.phpmac.com/articles.php?view=213 .
Just from the discussion here, I think there may be a few steps you've missed, like "building and installing libXML2" which it seems is required by PHP 5 now.

If you've got to be done by monday, then get to it! I hope your machine is reasonably fast for compiling some of this stuff.... :rolleyes:

AZGINBOGA, I hate to say it - but I followed the directions on this site and only ran into a little problem. I kept inadvertantly starting my 1.3 server (because there is a copy of apachectl in /usr/sbin) so I renamed my /apache2/bin/apachectl script to /apache2/bin/apache2ctl and I was up in running in less than an hour including compiling time.

So I would suggest you start with a clean slate, remove your install of Apache2 that you have now and start by building Apache2, LibXML and then PHP. This site is very helpful.

And yes, this is the only way (for now) to do this. The PHP module you downloaded from Marc's site was meant for Apache2 that comes with OS X Server - so it doesn't work - hence your problem.

Good luck
 
Ok, Im very confused now, which site should I follow to doWNload, install and configure apache2, php5 and mysql? also should I uninstall the stuff that I already dled? (apache2, php5, mysql) and I do this by drag and drop to trash? (sorry first time in my life Im using mac :))
 
I would suggest you open up your ssh port to allow some expert to ssh into your machine to fix it, though you have to allow him to have root access. But it would be rather difficult to get someone who is free to do that for you.
 
I would like to start from level 0, so how do I uninstall apache2, php5 and mysql4? :(
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.