Page 1 of 1

old php/mysql files not working on new xampp install

PostPosted: 11. February 2011 13:12
by dsdsdsdsd
hello,

I have had to re-format my computer, and with it I lost my old php5.2 and mysql ( don't know what version ).

I have decided to install xampp ( xampp control panel version 2.5 ) on my local laptop.

now, however, none of my php/mysql queries are working ... are there any most-obvious possibilities ... are there any default settings in xampp that typically cause this behavior?

I know my question is very vague :)

thanks,
Shannon

Re: old php/mysql files not working on new xampp install

PostPosted: 11. February 2011 14:04
by Sharley
PHP 5.2x has been replaced in 1.7.4 with PHP 5.3x and so if you want to go back to where everything worked then might I suggest installing XAMPP 1.7.1 which, as I recall, was the last XAMPP version with PHP 5.2x.

The older versions can be found here:
http://sourceforge.net/projects/xampp/files/XAMPP Windows/

Re: old php/mysql files not working on new xampp install

PostPosted: 11. February 2011 14:05
by dsdsdsdsd
here is ONE example of a php function that is not working:

print ( str_pad( 1 , 4 , "0" , "STR_PAD_LEFT" ) ) ;
//==> Warning: str_pad() expects parameter 4 to be long, string given in C:\xampp\htdocs\testing\index.php on line 18

Re: old php/mysql files not working on new xampp install

PostPosted: 11. February 2011 14:07
by dsdsdsdsd
Sharley, I'm not opposed to doing that, but I wonder if it is the version difference that is even causing the problem ... I have strange suspicion that there is some value in some config file that is doing something funny .... I'll look for the older xampp though and try it ... thanks.

Re: old php/mysql files not working on new xampp install

PostPosted: 11. February 2011 14:18
by Sharley
There was lots of issues with 5.3 in things like Wordpress, Joomla etc. that did not work with 5.3 but was quite happy with 5.2 - after the coders changed things to be compatible with 5.3 then they worked with that php version.

Some reading here

Good luck.

Re: old php/mysql files not working on new xampp install

PostPosted: 11. February 2011 15:42
by dsdsdsdsd
welp... xampp 1.7.1 does have php5.2.9, which seems to have solved some of the problems, but not all ...

example: include_once(...) - how can include_once be generating errors?? guess I will even try an older version of xampp in hopes of finding one that has an earlier php5.2.#

Re: old php/mysql files not working on new xampp install

PostPosted: 12. February 2011 13:19
by Altrea
dsdsdsdsd wrote:here is ONE example of a php function that is not working:
print ( str_pad( 1 , 4 , "0" , "STR_PAD_LEFT" ) ) ;
//==> Warning: str_pad() expects parameter 4 to be long, string given in C:\xampp\htdocs\testing\index.php on line 18


That is an example of RTFM!
The php Manual for str_pad() give you the answer, that the parameter is a constant and no string (no double-quotes around a constant)!

Re: old php/mysql files not working on new xampp install

PostPosted: 12. February 2011 13:24
by Altrea
dsdsdsdsd wrote:welp... xampp 1.7.1 does have php5.2.9, which seems to have solved some of the problems, but not all ...

example: include_once(...) - how can include_once be generating errors?? guess I will even try an older version of xampp in hopes of finding one that has an earlier php5.2.#


Well, you don't post the error here, so noone could say why this functions throws the error/warning/notice at your installation.
An earlier PHP 5.2 version will not help to solve that.

Could be that some PHP configuration can hide the message, but the issue will be the same. So maybe you should see if you can solve the issue the right way.

Re: old php/mysql files not working on new xampp install

PostPosted: 12. February 2011 14:59
by dsdsdsdsd
Altrea, I believe that you missed the point of my post ... I was not concerned about that individual error, but rather that I was all of the sudden getting hundreds of errors after installing a new xampp system.

you'll see that in my post I acknowledged that my post was very vague, and I was looking for any possible settings in xampp that might be doing something that I was not expecting.

if you're just going to be a jerk, don't respond.

turns out that the problem was not actually a problem at all: the new xampp system did not have error suppression turned on ( which is a good thing ) but my previous php installation did have error suppression turned - which I did not realize - and now all of my php-based apps from the last 3 years are displaying their error messages, which is how it should be.


Shannon

Re: old php/mysql files not working on new xampp install

PostPosted: 12. February 2011 17:31
by Altrea
dsdsdsdsd wrote:Altrea, I believe that you missed the point of my post ... I was not concerned about that individual error, but rather that I was all of the sudden getting hundreds of errors after installing a new xampp system.

I got that. It's not unusual that a change to a newer PHP Version or to a version with a different configuration will result in many php messages. You shouldn't be worried about that. Most of them can be solved very easy.

dsdsdsdsd wrote:if you're just going to be a jerk, don't respond.

I just wanted to help you with your messages. Thats all. If you don't want to get help with that thats okay too.

dsdsdsdsd wrote:I was looking for any possible settings in xampp that might be doing something that I was not expecting.

I don't know. Some messages can be the result of missing php extensions, but how could be know? Sure, it is possible that some options in the configs can clear some of your errors.
You are the only one with all informations needed to estimate that.

dsdsdsdsd wrote:turns out that the problem was not actually a problem at all: the new xampp system did not have error suppression turned on ( which is a good thing ) but my previous php installation did have error suppression turned

That's what i wanted to say with my last post. Sure, you can configure display_errors or error_reporting to not show these messages. But to hide messages is not always the answer. Messages have the function to indicate something to you.

If you need any help to solve some of these messages, i just can offer you my help.

Re: old php/mysql files not working on new xampp install

PostPosted: 11. March 2011 13:10
by em3g
I am having nearly the same problem. I was using xampp with php 5.3.1 or something then I downgraded to xampp with php v5.2.4 because most of my code was working better that way (old joomla - one that was happy with 5.2.x).
I then noticed that my host is using php 5.2.17, when i uploaded a site that i had developed earlier with php version 5.3.1. It was having problems that it didn't have when i was using php 5.3.1. My problem is that none of the XAMPP releases have php 5.2.17.

I know the site works well with 5.3.1 but i would like to try it on 5.2.17 since that is my host's before i make it work on 5.2.4.
My mission is on how do i install a different ver of php like 5.2.17 (that i downloaded from php.net) on a 5.2.4 installation?

This is what i did: I backed up my xampp and then extracted the php 5.2.17 package onto my php 5.2.4 folder in xampp\php, then copied the lines that were configured by xampp from php.ini (both in xampp\apache\bin\php.ini and xampp\php\php.ini) to new php.ini-dist and renamed to php.ini. Problem is xampp kept on reporting that i was running ver5.2.4 and errors were still there and even reported some dll issues. (Which I think was a result of nothing happened issue to my gain issue).

Is it possible to do what i want to do or there are tonnes of configurations that need to be done?