Database Problems, Windows 7 and php.ini

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Database Problems, Windows 7 and php.ini

Postby hwalker1 » 10. November 2010 14:47

I have installed Xampp and everything works as it should when I create and run a .php file. Except when that file contains any reference to a databse connection. When that happens, instead of generating the page, only the code appears in the browser. I am using version 1.7.3 on a 64 bit Windows 7 platform. My connection file successfully connects with the database when run in Dreamweaver, but when I try to preview a file in my browser, all I get is the code.
The code was originally written for PHP 4, and runs without any problem on my other installation, which dos not use xamp,with the components installed as seperate units. I was told that PHP 5 should be backwards compatible with most PHP4 code.

In addition, Windows 7 does not seem to display the file endings of .ini files, so it is hard to know which file is php.ini. A search for php.ini does not come up with a file of that name, but with a whole host of files called just php.

Does the standard install of xamp have an ini file that allows PHP and MySql to work together, or does it need changes.
hwalker1
 
Posts: 29
Joined: 10. November 2010 11:59
Location: United Kingdom
Operating System: Windows 7 Ultimate 64 bit

Re: Database Problems, Windows 7 and php.ini

Postby peterwt » 10. November 2010 16:43

I am using XAMPP latest version on Windows 7 64 bit without any problems, including database access.

To be able to see the file extensions in Explorer- in Explorer view - Tools/Folder Options - in View tab uncheck "Hide extensions for known file types".

Peter
Peter
peterwt
 
Posts: 42
Joined: 17. March 2009 11:06
Operating System: Windows 7 64 bit Professional

Re: Database Problems, Windows 7 and php.ini

Postby WilliL » 10. November 2010 17:31

it could be short_open_tag (standard OFF in PHP 5.3)
try instead of "<?" the "<?php" and instéad of "<?=" new "<?php echo"

you can also try to switch short_open_tag ON. http://community.apachefriends.org/f/viewtopic.php?f=16&t=42437&p=167272&hilit=short_open_tag#p167272
Willi
WilliL
 
Posts: 661
Joined: 08. January 2010 10:54
Operating System: Win7Home Prem 64 SP1

Re: Database Problems, Windows 7 and php.ini

Postby hwalker1 » 11. November 2010 23:49

peterwt wrote:I am using XAMPP latest version on Windows 7 64 bit without any problems, including database access.

To be able to see the file extensions in Explorer- in Explorer view - Tools/Folder Options - in View tab uncheck "Hide extensions for known file types".

Peter


Thanks for that Peter. I also found out why the database would not work. It is a combination of causes as usual, one to do with a missing view, on which I have posted again today, and the other to do with the fact that the database dump came from a server where all files had to have the .php5 extension in order to run. There is somewhere in PHP a way to allow unusual filename ends, but its a long time since I did it and I have not found it again, so I just renamed all the files ending in .php5 to end in .php and at least the files without database code related to a missing view now display and run. I'm not sure if this php / php5 thing is Xampp related or a Dreamweaver problem.
hwalker1
 
Posts: 29
Joined: 10. November 2010 11:59
Location: United Kingdom
Operating System: Windows 7 Ultimate 64 bit


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 66 guests