Re: [PHP] Question before upgrading to 5



Jake McHenry wrote:
I'll think about it.. We only use php for intranet applications I create,
so the server is basically dead at nights, which is when I do most of my
work.....


I have worked like that in the past - at some point I decided that going
to bed when I was tired rather then whenever thing X that I broke was fixed again
(which is usually hours after your eyeballs have fallen out :-/)

anyway I see you did do a dual apache setup, cool, and got it working properly.

you can now use ProxyPass to make your second apache available via port 80 -
which is nice because you don't have to keep typing the port number into the url
antoher bonus is the ability to hide the second apache from the outside world
by only making it listen to 127.0.0.1:8080 (for example) - note that the domain name used in the
url used your ProxyPass directives would need to resolve to 127.0.0.1

of course none of this is strictly necessary given that you are running tests and doing some development.
but it sure is a cool trick if you really need to run php4 sites and php5 sites on one production
server (clients generally don't appreciate it when you same their website is hosted at example.com:8080 ;-)




Jake McHenry wrote:
I don't want 2 instances of apache running, your over
thinking this... I

whatever, I guess we have different opinions about trying to
do things 'properly'.



only asked if I need to change only the prefix, or if there
is anything
else, to get both php versions installed.
so you have 2 versions of php installed. you can't run the
apache module of both
version simultaneously. so your going to shut down apache on
a production box
and then fiddle the config to run with the php5 module and
bring it back up.



The original config is from OS installation, so who knows what I could mess
up by doing this, this is why I'm asking, cause I don't want to screw up
php, apache would be just more to add on to it....



then what? you hope that all your sites/code runs okay with
php5? if it doesn't
you can only fix it if you keep running with the broken sites
on php5 otherwise you
can only unfiddle the config and stick with php4. no?




Its only 1 line in httpd.conf, just change from php4 module to php5
module..... Not that big of a deal....



Once I see my scripts are working
ok, or not, I'll be getting rid of php4. I'm not running a
dev machine, this
is production, and the only one I have currently,
you might consider that the machine whose screen your looking
at whilst reading this
is a perfectly good dev machine - you seem to on a windows
PC, which of itself is not
a problem in terms of setting up a dev environment that
suitably mirrors the apache/php/DB
configuration of your production server but you may have
issues with 'your' php code itself
depending the [OS] portability of the code.



Most of my stuff works on windows too, but some of the earlier scripts
accessing files don't work,, I've already considered moving the site to my
desktop while I upgrade the server.. But no........



given that the server in question is a production server
there is even more reason to
not disrupt service whilst testing your code on php5 - which
is exactly what a second
[temporary, custom] install of apache would allow you to do.
sure it's a bit more work
but it's also more professional - it means you can update the
'real' apache to run php5
in the safe knowledge that it will *work* with only a few
seconds of down time whilst
you restart the webserver process.

my backup died last week
and I haven't gotten the parts for it yet. Is prefix the
only option I need
to change? Or do I need to change these too?
no just change prefix. (although I'm not 100% sure about
localstatedir - I have never touched myself
and I do run various machines that have php4 and php5
installed [compiled by hand as you are doing])

btw - installing a second apache is rather the same as
installing a second copy of
php in so far as you can also specify a custom prefix to have
it install (and read it's config)
from some other place - so as not to interfere with the
production apache.




As long as I use prefix, all of these options point to
/prefix/otheroptiondirectories correct? Making prefix the root? So in
the OS installation of PHP and httpd, that's why it left prefix blank, and
put in the values below..... So with the config the way it is now... It
would overwrite php4 and I would really be screwed...



--datadir=/usr/share \
--includedir=/usr/include \
--libdir=/usr/lib \
--libexecdir=/usr/libexec \
--localstatedir=/var \
--mandir=/usr/share/man \
--infodir=/usr/share/info \
--with-exec-dir=/usr/bin \


Thanks,
Jake

Jake McHenry wrote:
Sorry about the delivery and read requests.. I was tired
and forgot to turn
them off for the list......

alternatively you can search for 'Rasmus' and 'ProxyPass'
in the list
archive and use Rasmus' rather cool ProxyPass solution to
running both
php4 and php5 ... his explanation should give you enough info
to set it up.

I don't need them running parallel, only both installed
I think you missed the point. you would have 2 apaches
running, that is correct
but the trick is to set it up so that they use the same
document roots
for each site that you are trying to convert.

the beauty of this is that you can literally run the same
site in php5 and php4
simulaneously with urls something *like*:

php4.mydevsite.com
php5.mydevsite.com (ProxyPassed to 'inner' apache)


were HOSTS file contains:

127.0.0.1 php4.mydevsite.com php5.mydevsite.com

and both outer and inner apache's use the same docroot for
the given site.

obviously it's just one way of setting up a comfortable dev
environment - as long
as you have something that allows you to doo your tihng
without to much pain then thats
the main thing :-)



Tijnema ! wrote:
On 3/22/07, Jake McHenry <linux@xxxxxxxxxxxxxxxxx> wrote:
Hi everyone,

I just got done going through all my configure options for
php5, and
finally
configure finished successfully... I didn't install it
yet, have a
question.
Can I have both 4 and 5 installed temporarily until I'm
sure all my
scripts
work ok? They should, I've been careful, but I want to be
sure since
this is
the only server I currently have. I was going to install
a virtual
copy of
fedora and do testing, but I don't have time, hopefully
someone can
answer.
I think I just have to change the prefix to something
other than
default and
load the new module in httpd. If I had more time I would
do this the
right
way, but we all know how that goes...

If this will work, I can then just uninstall 4.. Hopefully
it won't break
anything.

I'll post my configure options if anyone would like to
double check....
Thanks,
Jake
If you use make install on the second one, it will add
the libphp5
library to your httpd.conf, and then you would have libphp4 and
libphp5 in your httpd.conf. That is guaranteed to give
problems. So if
you comment out one of the 2, then it works fine.
Yes, I just wanted to make sure I only needed to change the
prefix to get
them both installed


.



Relevant Pages

  • Re: [PHP] Question before upgrading to 5
    ... you can't load both PHP4 and PHP5 into the same Apache as Modules. ... I was going to install a virtual ...
    (php.general)
  • Re: Installing Php5 on Apache2.2 (Freebsd 6.1)
    ... php index files ... automatically returned by Apache to browser when it goes to that url. ... When I do make install, it says that php5 is already installed. ...
    (freebsd-questions)
  • Any Php5 help for a newb
    ... I'm trying to get MySQL, Apache, and Php5 to play nice together in Windows ... I don't want to install those automatic 'all-in-one' packages because I want ... do I empty the contents of my public_html into htdocs? ...
    (comp.lang.php)
  • Re: Apache, php?
    ... Or do I have to reinstall apache after php5? ... I install them in the following order. ...
    (freebsd-questions)
  • Question before upgrading to 5
    ... I just got done going through all my configure options for php5, ... I didn't install it yet, ... I think I just have to change the prefix to something other than default and ... load the new module in httpd. ...
    (php.general)