Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Thu Sep 17, 2015 4:09 am 
Offline
Newbie

Joined: Thu Sep 17, 2015 3:51 am
Posts: 4
Sorry I am a very new hand for linux but I can finish the Linode Getting Started tutorial...etc. :?


I have a specification website that php version is very old ---> PHP Version 5.2.17 (if need, i can offer all phpinfo list detail.)

So Anyone can teach or help how to install php 5.2.17 version environment on linode virtualhost ? :roll:

EX:
--Under php 5.3 version or higher: <?php echo 'it works' ; ?>

--Under php 5.2 version: <?php echo 'no works'; ?> <=> <? echo 'it works'; ?>

and other deprecated function of php 5.2 version , I am sure that all you Senior can totally understand my meaning.

thank you very much. :mrgreen:

James


Top
   
PostPosted: Fri Sep 18, 2015 6:46 am 
Offline
Senior Member

Joined: Fri May 02, 2008 8:44 pm
Posts: 1121
I'm not aware of any easy way to install such an outdated version of PHP on a modern version of Ubuntu. You'll probably need to download the source code from the PHP release archives and compile it yourself.

Anyway, the short opening tag (<?) can be easily enabled, even on the latest version of PHP, by changing just one setting in php.ini. A lot of other "deprecated" features are like that, too. Why not try CentOS 6 with PHP 5.3.3, or Ubuntu 12.04 with PHP 5.3.10, and see if you can get your app to run on those versions? Most of the breaking changes, such as the removal of register_globals, occurred in PHP 5.4 and later.


Top
   
PostPosted: Sat Sep 19, 2015 12:17 pm 
Offline
Newbie

Joined: Thu Sep 17, 2015 3:51 am
Posts: 4
Thanks for your update~!
But I really need to set the environment of php 5.2 ...(php5.3 not work for my website,I tired...)

Today I tried to install php5.2.17 and others is...
--------------------
Unbuntu 12.04
php: 5.2.17
mysaql: 4.0
--------------------

When "make instal"l php5.2 , there is a issue that I check php version and key in "php -v", it show php 5.2 ,

but when I created a php file inside of code is phpinfo(); the browser show php 5.3 :|

Can anyone know what happened?

thank you !

James


Top
   
PostPosted: Sat Sep 19, 2015 3:19 pm 
Offline
Senior Member

Joined: Sun Aug 31, 2008 4:29 pm
Posts: 177
In my opinion you should be focusing your efforts on getting your site working with php 5.3. CentOS 6 provides php 5.3 and supports it for security updates until 2020.

Efforts to install php 5.2 are wasted (again, in my opinion) because that php version is unmaintained, has security issues and will lead to serious problems down the road.

Focus on fixing your app now to work with php 5.3. The changes from 5.2 to 5.3 were not major. Run php 5.3 with CentOS 6 and you have 4 years to plan for your next upgrade.

_________________
sleddog


Top
   
PostPosted: Sun Sep 20, 2015 12:13 am 
Offline
Senior Member

Joined: Fri May 02, 2008 8:44 pm
Posts: 1121
mag620 wrote:
When "make instal"l php5.2 , there is a issue that I check php version and key in "php -v", it show php 5.2 ,

but when I created a php file inside of code is phpinfo(); the browser show php 5.3 :|

Can anyone know what happened?


PHP includes multiple binaries. One is the CLI executable, which is what you're calling when you use the "php -v" command. Another is the Apache module, which is what you're using when you call a script from your browser. You need to remove your distro's PHP 5.3 Apache module and replace with with the one that you just compiled.

Next step: Do your best to hide the fact that you're running such an outdated version of PHP, because if someone finds out, your server will be pwned :oops:


Top
   
PostPosted: Sun Sep 20, 2015 10:47 am 
Offline
Newbie

Joined: Thu Sep 17, 2015 3:51 am
Posts: 4
sleddog wrote:
In my opinion you should be focusing your efforts on getting your site working with php 5.3. CentOS 6 provides php 5.3 and supports it for security updates until 2020.

Efforts to install php 5.2 are wasted (again, in my opinion) because that php version is unmaintained, has security issues and will lead to serious problems down the road.

Focus on fixing your app now to work with php 5.3. The changes from 5.2 to 5.3 were not major. Run php 5.3 with CentOS 6 and you have 4 years to plan for your next upgrade.



Thanks a lot for update!

I had recommend my boss and maybe I still need to do the stuff....

James


Top
   
PostPosted: Sun Sep 20, 2015 10:51 am 
Offline
Newbie

Joined: Thu Sep 17, 2015 3:51 am
Posts: 4
hybinet wrote:
mag620 wrote:
When "make instal"l php5.2 , there is a issue that I check php version and key in "php -v", it show php 5.2 ,

but when I created a php file inside of code is phpinfo(); the browser show php 5.3 :|

Can anyone know what happened?


PHP includes multiple binaries. One is the CLI executable, which is what you're calling when you use the "php -v" command. Another is the Apache module, which is what you're using when you call a script from your browser. You need to remove your distro's PHP 5.3 Apache module and replace with with the one that you just compiled.

Next step: Do your best to hide the fact that you're running such an outdated version of PHP, because if someone finds out, your server will be pwned :oops:


Thanks for update!!

I will try to check apache module with php5.2.

Next Step: Yes, It's so bad to do this....but thank you! :)


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 3 guests


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

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group