Entropy.ch Discussion Forums Forum Index Entropy.ch Discussion Forums
Discussion forums about Mac OS X software development.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

SOLVED: Entropy working on 10.5 after lots of errors
Goto page 1, 2, 3  Next
 
Post new topic   Reply to topic    Entropy.ch Discussion Forums Forum Index -> PHP on Mac OS X
View previous topic :: View next topic  
Author Message
davidje13



Joined: 05 Jun 2008
Posts: 14

PostPosted: Fri Jun 06, 2008 16:23    Post subject: SOLVED: Entropy working on 10.5 after lots of errors Reply with quote

I found a solution to my install problems, so I'm updating this thread to be a reference to others. I'm using a 64 bit intel machine with 10.5.3


First, as it says, if you've used the built in PHP already, remember to re-comment the PHP line in httpd.conf before starting.

OS X 10.5 uses Apache 2. You can check that on your computer with this terminal command:
Code:
httpd -v

which will return something like
Code:
Server version: Apache/2.2.8 (Unix)
Server built:   Mar  4 2008 21:37:02

Downloaded whatever version of entropy matches this, in my case that was "PHP 5.2.4 for Apache 2"

Pre-emptive Problem 1: Installation error
BEFORE YOU INSTALL, open a terminal and type this:
Code:
sudo ln -s /etc/apache2 /etc/httpd

(if you have already tried installing and saw an error message, delete the entropy receipts in your /Library/Receipts/ folder then carry on)

Now install the entropy package you downloaded.

At this point, check if you can access localhost. If you can, well done you're ok. If you can't, keep reading. Here's how to fix it:

Problem 2: Apache is 64 bit, entropy is 32 bit.
The only solution to this that I've seen is to force Apache to be 32 bit. For intel based machines:
Code:
sudo cp /usr/sbin/httpd /usr/sbin/httpd-fat
sudo lipo /usr/sbin/httpd -thin i386 -output /usr/sbin/httpd

that will strip everything except the 32 bit intel code from httpd (after making a backup), forcing it to be 32 bit. For PPC, the command will be similar.
This fix is a bit tacky, but shouldn't cause any problems.

Problem 3: libexpat.0.dylib
Now there is a problem with a missing file. Fortunatley, it seems that this file is on 10.5, just in a different place and with a different name! Here's how to get it working:
Code:
sudo ln -s /usr/local/php5 /usr/local/apache2
sudo ln -s /usr/lib/libexpat.dylib /usr/local/apache2/lib/libexpat.0.dylib


Done
And that should be everything. Just restart Apache
Code:
sudo apachectl restart

and you're away Smile
Back to top
View user's profile Send private message
PetitPaul



Joined: 24 Jun 2005
Posts: 2

PostPosted: Wed Jun 18, 2008 15:35    Post subject: Installing entropy php package still not working Reply with quote

Hello,

Many thanks for you contribution, but for me it still does not work: I still have the postflight script failed installation error.

I've deleted the receipts, re-commented the line in httpd.conf, typed the correct lines. Still it wont work. The error still appears at the end of install and php5 is not working.

I can only uncomment the line in httpd.conf to get php5 working again but only with apple standard installation, which does not have pear nor mcrypt library which I need.

Any idea?

Thanks in advance,

Petit Paul,
Back to top
View user's profile Send private message
davidje13



Joined: 05 Jun 2008
Posts: 14

PostPosted: Wed Jun 18, 2008 20:03    Post subject: Reply with quote

hmm, very odd

try this - open finder and go to /etc/ (press ctrl+shift+G and type /etc/) and tell me if there's a shortcut (alias, whatever you want to call it) in there called httpd. If there is, double click it and check that it takes you to apache2.

If it says "The folder cannot be found" when you try going to /etc/ then you need to do this as well; (do NOT do this if you don't get that message though)
Code:
sudo ln -s /private/etc /etc

(I think I might have done that a long time ago to get something else working)
you'll need to re-enter the "sudo ln -s /etc/apache2 /etc/httpd" command after (and re-run the installer)

If it still doesn't work, did you get any errors when you entered the codes I mentioned? If it does work, tell me and I'll update the guide.
Back to top
View user's profile Send private message
PetitPaul



Joined: 24 Jun 2005
Posts: 2

PostPosted: Wed Jun 18, 2008 20:40    Post subject: It works now. Reply with quote

Ok.

I checked the alias and it was there allright, but it had an icon of a document alias, not a directory alias, and upon clicking on it there was the message saying that original document couldn't be found.

(I use Tinkertool to see all hidden files and folder in the finder)

So I trashed it and recreated the alias with the proper terminal line, which I probably did not typed correctly in the first attempt.

I re-quoted the line in httpd.conf (I use BBEdit for text coding), reinstalled the entropy package, restarted Apache, and now it works fine. No alert and a phpinfo file reveals that Apache is now loading the correct Entropy php5.

Many thanks, for this.

If you're in Brussels sometimes, give me a call and I'll invite you to a nice restaurant.

Paul,
Back to top
View user's profile Send private message
agerson



Joined: 03 Jul 2008
Posts: 2

PostPosted: Fri Jul 04, 2008 15:50    Post subject: Reply with quote

This also work os Mac OS Server 10.5.4. After following the steps I above I also had to edit:

Code:
/private/etc/apache2/httpd.conf


and change

Code:
#LoadModule php5_module libexec/apache2/libphp5.so


to

Code:
LoadModule php5_module local/php5/libphp5.so
Back to top
View user's profile Send private message
jweinberger



Joined: 25 Mar 2005
Posts: 8

PostPosted: Sun Jul 06, 2008 5:55    Post subject: Reply with quote

I"m having the same problem with the postflight script in the installer failing.

the /etc alias is there and correct, but I deleted it and recreated it for good measure (seeing as it helped someone else...), to no avail - it still does not work.

I can avoid using the installer if I could find the correct ./configure command to install from the command line.

The one I've seen before for Marc's package uses

Code:
--with-jpeg-dir=/usr/local/php5

and
Code:
--with-png-dir=/usr/local/php5


which causes a failure with GD, which I need. (I also need IMAP, and that causes failures, too...still working on diagnosing those).

I suspect the two items are related (as in the postflight script puts the JPEG dir in the right place)

Can anyone suggest either:

1) how to get the installer working, or
2) where the postflight script is and how to get it working, or
3) how to get the libraries in the right places (this is important for when I have to recompile myself for upgrades...)

Any help or suggestions are very much appreciated! Thank you!
Back to top
View user's profile Send private message
erdqwjw



Joined: 13 Jun 2008
Posts: 1

PostPosted: Sun Jul 13, 2008 0:17    Post subject: mysql tip Reply with quote

Great post - works for 10.5.4 ordinary desktop systems too - though you don't have to bother with problem 2 (64 bit)

Found I can now switch between Entropy and OSX shipped php by alternating the settings in /etc/apache2/httpd.conf

BUT if you have used the OSX shipped php with MYSQL you will probably have made a /etc/my.cnf to get mysql working:

/etc/my.cnf contains
[client]
socket = /var/mysql/mysql.sock

[mysqld]
socket = /var/mysql/mysql.sock

You need to remove the contents of /etc/my.cnf and restart to get mysql working with Entropy php (which expects the mysql socket to be in /tmp not /var/mysql)

hope this helps
_________________
----

Bill Worthington
Back to top
View user's profile Send private message
kringfingel



Joined: 14 Jul 2008
Posts: 1

PostPosted: Mon Jul 14, 2008 14:01    Post subject: Reply with quote

thank you for the hint with 64/32 bits, this helps even with the apple-shipped php.

In my case I had exiting child processes when using the php from apple on Leopard 10.5.4 together with Net_SMTP from pear. I described it more exactly in the phenotype forum.

maybe this information is helpful for someone else

Michel
Back to top
View user's profile Send private message
Josh



Joined: 16 Jul 2008
Posts: 10

PostPosted: Wed Jul 16, 2008 16:26    Post subject: Reply with quote

Thanks a lot for your effort, davidje13. I'm not into UNIX and stuff at all so I'm very thankful that you posted a solution to these problems.
Back to top
View user's profile Send private message
_ryan



Joined: 20 Jul 2008
Posts: 2

PostPosted: Sun Jul 20, 2008 14:14    Post subject: This method failed on G5 PPC Reply with quote

I tried this install method on my G5 Power Mac. Apache does not seem to work at all now. My knowledge in this area is pretty limited, and I would appreciate any help.
Back to top
View user's profile Send private message
davidje13



Joined: 05 Jun 2008
Posts: 14

PostPosted: Sun Jul 20, 2008 15:38    Post subject: Reply with quote

Ok, when Apache stops working the best thing to do is this command in the terminal:
Code:
apachectl configtest

the result of that should help you find the specific problem. Post it here if not.

If you just want to give up on entropy, these will revert the main changes:

Make Apache 64-bit again (this probably isn't necessary)
Code:
sudo cp /usr/sbin/httpd-fat /usr/sbin/httpd


Undo the installation of Entropy (this should fix your problem but by reverting to the original PHP)
in /usr/local/php5/entropy-php.conf
comment out the entropy PHP line: (add a # to the start)
Code:
LoadModule php5_module        /usr/local/php5/libphp5.so

and uncomment the original PHP line
Code:
#LoadModule php5_module        libexec/apache2/libphp5.so

note: you won't be able to use textedit to make these changes. I use vi (in the terminal type sudo vi /usr/local/php5/entropy-php.conf), which is a keyboard-only editor (basics: press i to begin editing, and escape :wq enter to save and exit). There are nicer editors that do the job, some other members might be able to point you to them.
Back to top
View user's profile Send private message
_ryan



Joined: 20 Jul 2008
Posts: 2

PostPosted: Tue Jul 22, 2008 0:08    Post subject: Reply with quote

First - thank you for your time and response

I ran the apachectl configtest and got the following reply:

Code:
/usr/sbin/apachectl: line 102: /usr/sbin/httpd: Bad CPU type in executable


I opened /usr/sbin/apachectl with TextWrangler and found the following:
Code:
...
101>   configtest)
102>   $HTTPD -t
103>   ERROR=$?
104>    ;;
...


I opened /usr/sbin/httpd with TextWrangler, but it is mostly a bunch of garbage that I can't read. The date modified for that file is 3/5/08. The date modified for httpd-fat is 7/19/08 (as expected). This made me think that the 64 -> 32 bit change to httpd didn't happen. However, content of the two files does appear to be different.

Does any of this give you any ideas, or should I just go ahead and try to back out of the entropy as you described above?

Thanks.
Back to top
View user's profile Send private message
davidje13



Joined: 05 Jun 2008
Posts: 14

PostPosted: Tue Jul 22, 2008 21:51    Post subject: Reply with quote

Ah, that message could be because the G5 isn't intel-based (I think)
this should fix it; (assuming you didn't change the line to begin with)

Code:
sudo cp /usr/sbin/httpd-fat /usr/sbin/httpd
sudo lipo /usr/sbin/httpd -thin ppc7400 -output /usr/sbin/httpd

(should revert it to the backup then trim it to 32-bit ppc)

if that fails it might be worth double-checking you downloaded the right version of entropy for your computer. Further than that I can't think of anything.
Back to top
View user's profile Send private message
Wolfman



Joined: 16 Aug 2007
Posts: 4

PostPosted: Fri Jul 25, 2008 22:01    Post subject: Reply with quote

If you are running 10.5 server, why are you going through the trouble to install the entropy php 5.24 package?

Perhaps I am missing something. 10.5.4 server with updates already includes php v.5.25, which of course is also already outdated.

I ran a test and moved one of our websites to this and after loading some additional pear modules, it was running well with zero issues with mysql.

Now I need 5.26...
Back to top
View user's profile Send private message
Synchro



Joined: 28 Jan 2008
Posts: 6

PostPosted: Mon Jul 28, 2008 8:42    Post subject: Reply with quote

Wolfman wrote:
Perhaps I am missing something. 10.5.4 server with updates already includes php v.5.25, which of course is also already outdated.


I guess you've never used the PHP on OS X server. It's missing vital modules and doesn't allow others to be added dynamically. The most popular PHP packages won't run properly on it.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Entropy.ch Discussion Forums Forum Index -> PHP on Mac OS X All times are GMT + 1 Hour
Goto page 1, 2, 3  Next
Page 1 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group