Ioncube and Mac 10.5.6

You can ask general questions about MAMP here.

Moderator: severin

Ioncube and Mac 10.5.6

Postby DaveH » Mon Jan 12, 2009 10:52 pm

Not so much a problem, but more I hope a solution if you have this problem. I am working with Joomla using MAMP and had a component which required ioncube loader.

After a few abortive attempts I submit this as a working solution (well it works here!).

Download the file ( ioncube_loaders_dar_x86.zip ) note that there are 2 potential files on the site X86 and X86_64 I'm using an Intel Core 2 Duo and the x86 is the one that worked for me. (http://www.ioncube.com/loaders.php)

Expand and copy the file ( ioncube_loader_dar_5.2.so ) into the -> Applications/MAMP/bin/php5/zend/lib/ folder.

Open the file -> Applications/MAMP/conf/php5/php.ini

Add this line -> zend_extension=/Applications/MAMP/bin/php5/zend/lib/ioncube_loader_dar_5.2.so at line 1085

Stop and start the servers and the component now works like a charm!

At this point I should say that my MAMP is running the "out the box" settings and I've got a pretty well "plain vanilla" 10.5 installation. So I'm making the assumption that you are also running with php 5.2 and thread safety disabled.

Hope this helps sombody.
DaveH
 
Posts: 5
Joined: Mon Jan 12, 2009 10:24 pm

Re: Ioncube and Mac 10.5.6

Postby jbarron » Sun Jan 25, 2009 12:04 am

DaveH-

You are my life saver! I have been struggling with this for a couple weeks, and this was the exact solution I was looking for! Thank you SO much. It "worked like a charm" just like you said.
jbarron
 
Posts: 1
Joined: Sun Jan 25, 2009 12:01 am

Re: Ioncube and Mac 10.5.6

Postby DaveH » Sat Jan 31, 2009 3:08 pm

One other problem occured after I had done the above.

The installed component (iJoomla Surveys tho' I suspect that this isn't a problem related to only this component) wouldn't allow me to start a new survey - when I tried I kept getting an ....index2.php unavailable error.

The answer to this is to edit the /MAMP/conf/php5/php.ini file.

At line 232 if you change -> memory_limit = 8M .. -> to memory_limit = 32M

Again I hope this helps somebody.
DaveH
 
Posts: 5
Joined: Mon Jan 12, 2009 10:24 pm

Re: Ioncube and Mac 10.5.6

Postby jmcbade » Wed Mar 25, 2009 10:58 am

Well,

I think I have tried all these above to the "letter". I can not get my MAMP PRO 1.7.2 install to load ioncube for PHP 5.2

Anything special about MAMP 1.7.2?

I am editing the php5.ini from within the MAMP application.

I have tried loading from the path that the ioncube helper suggests. I have tried from really simple path as well. I just can get it to load.

If my ioncube folder in directly under htdocs in the regular MAMP directory, I am running pro but I am running the "localhost" default host and from the default MAMP directory, what would be the path in the ini file? Just a sanity check here please, becasue I am going crazy with trying to get this working.

Thanks,

-John
jmcbade
 
Posts: 3
Joined: Wed Mar 25, 2009 9:14 am

Re: Ioncube and Mac 10.5.6

Postby DaveH » Wed Jun 03, 2009 9:39 pm

John
Sorry about the delay in replying.
I can't say that I have any knowledge of MAMP PRO using as I am the "Lite" version.
The only "steer" that I can offer is that you say you are "editing the php5.ini from within the MAMP application", if you mean by this that you are physically in the text of the php.ini file using MAMP (I'm making the call that MAMP PRO has a text edit function here) then perhaps it may be better if you used a text editor designed for the job instead? Also you did have the servers shut down when making the edit? (I've no idea if this would make a difference but that was their status when I was in the file)
For what it's worth in my "lite" installation (and I've just had to edit it again to increase the memory - see my second post) there is no php5.ini file - it's php.ini in a folder php5 - and the path is definitely applications/mamp/conf/php5/
So it may well be that there are inherent differences between the PRO and the Lite versions - you could always download the Lite version and see if you can get it to work!
Hope this is of help.
Regards
Dave
DaveH
 
Posts: 5
Joined: Mon Jan 12, 2009 10:24 pm

Re: Ioncube and Mac 10.5.6

Postby bcoppersmith » Thu Jul 23, 2009 9:41 am

I too am tearing my hair out. I have trid nearly every permutation trying to install ioncube (Mac 10.5.6/PHP 52/Mamp 1.7.3/Zend Optimiser installed. It seems that no matter what I try. when I restart the server the path to ioncube gets deleted from the php.ini file ... I have this ...

[Zend]
zend_extension=/Applications/MAMP/bin/php5/zend/lib/ioncube_loader_dar_5.2.so
zend_optimizer.optimization_level=15
zend_extension_manager.optimizer=/Applications/MAMP/bin/php5/zend/lib/Optimizer-3.3.3
zend_optimizer.version=3.3.3
zend_extension=/Applications/MAMP/bin/php5/zend/lib/ZendExtensionManager.so

The ioncube_loader_dar_5.2.so file is in this path but I end up with this after server reboot?

[Zend]
zend_optimizer.optimization_level=15
zend_extension_manager.optimizer=/Applications/MAMP/bin/php5/zend/lib/Optimizer-3.3.3
zend_optimizer.version=3.3.3
zend_extension=/Applications/MAMP/bin/php5/zend/lib/ZendExtensionManager.so

Any help VERY much appreciated
bcoppersmith
 
Posts: 9
Joined: Tue Nov 18, 2008 3:34 am

Re: Ioncube and Mac 10.5.6

Postby DaveH » Thu Jul 23, 2009 5:59 pm

OK I'm making no claims at being an expert here but having crawled over my php.ini file might I offer the following.

If I remember correctly it is critical that the zend_extension=.... is inserted at line 1085 (by my editor's line count) - this is immediately after the [exif] .....;end instructions. There then follows around 15 lines of eaccelerator.xx instructions.

What you have written in your post [Zend] ..... in my php.ini file (and if it's coming from the same source I'll make the call that it is likely the same file) doesn't appear until line 1168 where indeed I have the very 4 lines which you have in your post. (Though for some reason I have 3 blank lines between between the lines 3 and 4 - I doubt if that's critical but mention it just in case!)

For the sake of being comprehensive I'm using the Smultron text editor - though again I would imagine that isn't critical.

From your post it looks like you are inserting the zend_extension=... line in the wrong place - try it just after the [exif] section and see what happens.

Hope this helps

Dave
DaveH
 
Posts: 5
Joined: Mon Jan 12, 2009 10:24 pm

Re: Ioncube and Mac 10.5.6

Postby bcoppersmith » Fri Jul 24, 2009 12:07 am

Many thanks DaveH for you help ...
But still no joy. I put the code at line 1085 (which looks like its in exactly the same place as yours) ... it just got stripped out again? I am thinking that Zend Optimizer might be the problem. Pouring over the MAMP logs it seems that during the server startup the php.ini gets copied to the Zend directory, bits added and subtracted, and replaced in its original place. Just guessing though.
I put the ioncube path in several other places as well and it always gets removed ... very frustrating!
bcoppersmith
 
Posts: 9
Joined: Tue Nov 18, 2008 3:34 am

Re: Ioncube and Mac 10.5.6

Postby jmcbade » Fri Jul 24, 2009 12:57 am

Are you using MAMP or MAMP Pro?
jmcbade
 
Posts: 3
Joined: Wed Mar 25, 2009 9:14 am

Re: Ioncube and Mac 10.5.6

Postby bcoppersmith » Fri Jul 24, 2009 1:49 am

MAMP pro ...
bcoppersmith
 
Posts: 9
Joined: Tue Nov 18, 2008 3:34 am

Re: Ioncube and Mac 10.5.6

Postby DaveH » Fri Jul 24, 2009 9:12 pm

I have to state that this is just conjecture on my part knowing absolutely zip about the inner workings of MAMP/php/zend..
I can't think why the php.ini file is being altered when it is run - it is after all just a list of settings which is referred to, for the file to have added lines removed would imply that there was a "true" reference copy to which your amended version was compared. This would in turn mean that any other changes made would be reset - you could I suppose check this by altering something like the safe_mode at the start of the file, fire MAMP up, shut it down and see what happened?
I suppose the another alternative would be to set the permissions on the file to read only?
Finally - and probably on reflection firstly - why not try with the Lite version?
Best of luck
Dave
DaveH
 
Posts: 5
Joined: Mon Jan 12, 2009 10:24 pm

Re: Ioncube and Mac 10.5.6

Postby bcoppersmith » Fri Jul 24, 2009 9:56 pm

Thanks a lot Dave ... I tried changing a few other settings and they are all returned to their previous settings. So looks like its not just ioncube that's a problem. But where is the "global" php.ini info coming from? I really do suspect the Zend optimizer is involved. I have tracked down a few c++ files that might be involved. The php_globals.h and zend_globals.h seem to work in collaboration and have a lot of references to php.ini settings like safe_mode, memory_limit, etc.
Not willing to change these files without a little help though as I'm certainly no c++ boffin!
bcoppersmith
 
Posts: 9
Joined: Tue Nov 18, 2008 3:34 am

Re: Ioncube and Mac 10.5.6

Postby bcoppersmith » Fri Jul 24, 2009 10:09 pm

Hey Dave
Are you any good with php coding? I think I have found the answer and it IS Zend that's doing it! Here is the code in the Zend install.php file that comes with Zend optmizer-3.3.3-darwin ... but how to stop it or change it?

/* do php.ini modifications */
$INSTALL->php_ini_open();

$INSTALL->php_ini_add_zend_section();

# 2.6.2- no need for this directive any more.
#$INSTALL->php_ini_add_entry("zend_optimizer.optimization_level", 15);
$INSTALL->php_ini_add_zend_extension($INSTALL->conf['prefix']."/lib/ZendExtensionManager.so");

# Remove ZendOptimizer.so zend_extension entry before using ZendExtensionManager
$INSTALL->php_ini_remove_entry("ZendOptimizer.so");

if(!isset($keep_existing["optimizer"])) {
$INSTALL->php_ini_add_entry("zend_extension_manager.optimizer",
$INSTALL->make_path($INSTALL->conf['prefix'], "lib",
"Optimizer-".$INSTALL->get_component_version("optimizer")));
}

if($INSTALL->conf['uname']['sysname'] != "AIX" && $INSTALL->conf['uname']['sysname'] != "Darwin"){
if(!isset($keep_existing["optimizer"])) {
$INSTALL->php_ini_add_entry("zend_extension_manager.optimizer_ts",
$INSTALL->make_path($INSTALL->conf['prefix'], "lib",
"Optimizer_TS-".$INSTALL->get_component_version("optimizer-ts")));
}

if(!isset($keep_existing["extension_manager"])) {
$INSTALL->php_ini_add_zend_extension($INSTALL->make_path($INSTALL->conf['prefix'], "lib",
"ZendExtensionManager_TS".$INSTALL->conf['so_ext']), "zend_extension_ts");
}
}

$INSTALL->add_package_info();

$INSTALL->php_ini_reorder();
$INSTALL->php_ini_fix();
$INSTALL->php_ini_close();

$INSTALL->php_ini_relocate();
bcoppersmith
 
Posts: 9
Joined: Tue Nov 18, 2008 3:34 am

Re: Ioncube and Mac 10.5.6

Postby bcoppersmith » Fri Jul 24, 2009 10:11 pm

Or is the install.php only used once when installing the Optimizer? In which case I'm back up a blind alley?
bcoppersmith
 
Posts: 9
Joined: Tue Nov 18, 2008 3:34 am

Re: Ioncube and Mac 10.5.6

Postby bcoppersmith » Fri Jul 24, 2009 10:37 pm

OK... I FOUND IT. AND I FEEL LIKE A REAL DUMMY ...
MAMP menus ... File/Edit Template/PHP5 php.ini ... add the ioncube loader path at line 1085 ... DONE!

:oops:
bcoppersmith
 
Posts: 9
Joined: Tue Nov 18, 2008 3:34 am

Next

Return to General questions

Who is online

Users browsing this forum: Google [Bot], Yahoo [Bot] and 4 guests