Page 1 of 1

php4 and php5 - whats the best way?

Posted: Thu Nov 30, 2006 4:43 pm
by nolanpro
I’m in a rather strange predicament. I’ve got some php5 files I need run from a php4 system. If my php5 files were actually php4, I would just include or require them in my php4 files and everything would be great.

My server allows both php4 and php5, as long as the php5 files are named with a php5 extension.

Is there a way to eval or exec php5 scripts from a php4 file? If so, how would I pass values to it? I suppose I could curl or fsockopen but that sounds messy.

I really wish those files weren’t php5 but they need the php5 soap functions. The content management system I’m incorporating it with is all php4 and it doesn’t support php5.

Any help would be greatly appreciated!

Thanks!!!

Posted: Thu Nov 30, 2006 4:48 pm
by volka
If you nedd php 5 functionality let php 5 handle the request (including all necessary script files).

Posted: Thu Nov 30, 2006 5:07 pm
by nolanpro
The problem is the php5 files are just a small insert in a joomla CMS. Because all scripts in joomla are dependent on each other (and dependent on php4 unfortunately) I cant just seperate part of the site and make it php5.

What I'm hoping to do is just pop in a require, include, exec, eval or anything at a certain point in the joomla script, that will run those php5 files (as php5). But I also have to send at least one variable (could be an array) to that php5 file from where is called in php4.

Thanks!

Posted: Thu Nov 30, 2006 5:35 pm
by volka
http://www.joomla.org/content/view/154/52/ wrote:Joomla! will support installation and use with PHP 5 and MySQL 4.1
Are there any issues with running joomla with php5?

Posted: Thu Nov 30, 2006 5:50 pm
by nolanpro
I’ll look into that, people use to complain about lots of errors in joomla on php5 but maybe there fixed now.

Are all functions of php4 useable in php5?

Posted: Thu Nov 30, 2006 6:09 pm
by nolanpro
I would use

Code: Select all

<? system("php5 thefile.php5", $return); ?>
from a php4 file but it returns a fork error, even though it works perfectly on the command line.