Question about Apache on 11.2 and up

I’m currently using OpenSuse 11.1 web server. This is bad since 11.1 is no longer supported. the reason why I am using it is because Function set_magic_quotes_runtime() was no longer being used. (so I was told)

That being said, is there a way to get Function set_magic_quotes_runtime() to function on the newer versions of OpenSuSE?

On Thu, 31 Mar 2011 02:06:02 +0530, abacabb
<abacabb@no-mx.forums.opensuse.org> wrote:

>
> I’m currently using OpenSuse 11.1 web server. This is bad since 11.1 is
> no longer supported. the reason why I am using it is because Function
> set_magic_quotes_runtime() was no longer being used. (so I was told)
>
> That being said, is there a way to get Function
> set_magic_quotes_runtime() to function on the newer versions of
> OpenSuSE?
>

this has nothing to do with openSUSE version, but the PHP version used;
the function has been deprecated since PHP ver. 5.3. you’ll either have to
install an earlier version of PHP by compiling it from source, or change
your PHP code to not use that function. you may find a starting point
here: http://php.net/manual/en/function.set-magic-quotes-runtime.php


phani.

Thank you for your response.

I think installing from source sounds like a more realistic approach for me since I am not a programmer. Could you explain or maybe point me towards a document that explains how to compile PHP 5.2.17 from source and install it?

I’d like to use OpenSuSE 11.4.

On Thu, 31 Mar 2011 20:36:01 +0530, abacabb
<abacabb@no-mx.forums.opensuse.org> wrote:

> I think installing from source sounds like a more realistic approach
> for me since I am not a programmer. Could you explain or maybe point me
> towards a document that explains how to compile PHP 5.2.17 from source
> and install it?
>
> I’d like to use OpenSuSE 11.4.
>

first you’ll have to get the source, from here:
http://www.php.net/downloads.php

you find the most accurate information for this particular version of PHP
in the INSTALL file of the downloaded source. here are some more extensive
instructions: http://www.php.net/manual/en/install.unix.apache2.php

i have done this a few times but don’t do it regularly, so don’t remember
the exact steps. i do remember that i had to do some searching & fiddling,
because i’m using a 64bit system, and the standard location of some
dependencies are taken from 32bit systems; these need to be replaced
during the ./configure process.

i wanted to keep the original versions of apache2 & PHP intact, so i
compiled both to a different location (to be specified during ./configure
with --prefix=<whatever>), with their own configuration files. if you want
to use the older version of PHP only, you may not have to compile apache2
at all. in either case, you’ll have to specify the locations of some
apache libraries when configuring PHP.


hope that helps, phani.

On Thu, 31 Mar 2011 23:05:02 +0530, phanisvara <listmail@phanisvara.com>
wrote:

> On Thu, 31 Mar 2011 20:36:01 +0530, abacabb
> <abacabb@no-mx.forums.opensuse.org> wrote:
>
>> I think installing from source sounds like a more realistic approach
>> for me since I am not a programmer. Could you explain or maybe point me
>> towards a document that explains how to compile PHP 5.2.17 from source
>> and install it?
>>
>> I’d like to use OpenSuSE 11.4.
>>
>
> first you’ll have to get the source, from here:
> http://www.php.net/downloads.php
>
> you find the most accurate information for this particular version of
> PHP in the INSTALL file of the downloaded source. here are some more
> extensive instructions:
> http://www.php.net/manual/en/install.unix.apache2.php
>
> i have done this a few times but don’t do it regularly, so don’t
> remember the exact steps. i do remember that i had to do some searching
> & fiddling, because i’m using a 64bit system, and the standard location
> of some dependencies are taken from 32bit systems; these need to be
> replaced during the ./configure process.
>
> i wanted to keep the original versions of apache2 & PHP intact, so i
> compiled both to a different location (to be specified during
> ./configure with --prefix=<whatever>), with their own configuration
> files. if you want to use the older version of PHP only, you may not
> have to compile apache2 at all. in either case, you’ll have to specify
> the locations of some apache libraries when configuring PHP.
>

you may find these links helpful as well:

this is for an older version of PHP, but most steps remain the same, and
it’s even more extensively explained:
http://www.web-tech-india.com/articles/php/compiling_php_apache/

this is a faq of possible problems from php.net:
http://www.php.net/manual/en/faq.build.php


phani.

Yea I’ll probably want to do apache as well.

Before you get yourself into a lot of work, you should read the first comment on that PHP manual page. It shows you how to work around this loss of this function.

PHP: set_magic_quotes_runtime - Manual

Better still would be to fix the program to not require this feature.

On Fri, 01 Apr 2011 05:06:02 +0530, ken yap
<ken_yap@no-mx.forums.opensuse.org> wrote:

>
> Before you get yourself into a lot of work, you should read the first
> comment on that PHP manual page. It shows you how to work around this
> loss of this function.
>
> ‘PHP: set_magic_quotes_runtime - Manual’
> (http://php.net/manual/en/function.set-magic-quotes-runtime.php)
>
> Better still would be to fix the program to not require this feature.
>

he wrote he wasn’t a “programmer,” which i understand to mean he doesn’t
know his way around PHP too well. in that case it might be easier to
compile PHP/apache2 rather than learning PHP to the extent that would
allow him to modify a CMS or web application.

eventually the developers / maintainers of that app. will get around to
upgrade it for PHP 5.3, but in the meantime he’ll have to use something.

also depends on whether he serves his web-app. from his own machine or
uses an external web host. many webhosts haven’t switched to PHP 5.3 yet,
and if he uses his own machine only for development/testing, it makes
sense to run the same PHP version the host does.


phani.

Yeah, but PHP isn’t normally obfuscated source. How hard can it be to grep for the place with that function call and use an editor, say nano, to replace that call with ini_set() as shown in the comment, compared to compiling and installing Apache and PHP? Even if I didn’t know my way around Apache and PHP, I know which one would be easier for me.

Also that error message is a warning and could in the worst case be ignored for the time being.

On Fri, 01 Apr 2011 06:36:04 +0530, ken yap
<ken_yap@no-mx.forums.opensuse.org> wrote:

>
> Yeah, but PHP isn’t normally obfuscated source. How hard can it be to
> grep for the place with that function call and use an editor, say nano,
> to replace that call with ini_set() as shown in the comment, compared to
> compiling and installing Apache and PHP? Even if I didn’t know my way
> around Apache and PHP, I know which one would be easier for me.
>
> Also that error message is a warning and could in the worst case be
> ignored for the time being.
>

well, PHP code can get pretty complex. i’ve done it both ways, and if
using a web host, i usually prefer to replicate that hosts conditions on
my local machine as close as possible. up to the OP of course, whatever he
dis/likes most.


phani.

On Fri, 01 Apr 2011 06:41:47 +0530, phanisvara <listmail@phanisvara.com>
wrote:

> well, PHP code can get pretty complex. i’ve done it both ways, and if
> using a web host, i usually prefer to replicate that hosts conditions on
> my local machine as close as possible. up to the OP of course, whatever
> he dis/likes most.

also if he uses some CMS or such, some of them get updates & fixes pretty
often. he’d have to re-do his modification every time one of the files
gets changed. not nice.


phani.

Or just ignore the warning for now and pester the author to fix it soon.

On Fri, 01 Apr 2011 07:36:01 +0530, ken yap
<ken_yap@no-mx.forums.opensuse.org> wrote:

>
> Or just ignore the warning for now and pester the author to fix it soon.
>

yes. some web apps display such warnings on screen for visitors, but that
can be changed via php.ini or .htaccess.


phani.