phpgroopie Posted September 21, 2007 Share Posted September 21, 2007 Hi All, Sorry for the very noob question but I am not a PHP programmer. I have a client that asked me to publish a website on IIS that someone else developed for them. It is all PHP and accesses a MySQL database. I got the website to display but it will not access the database. Come to find out the development was on a UNIX box. I have been able to modify the mysql_connect statement a little and it authenticated to the DB server but it will not access the data. Will this work or does it need to run on a UNIX box? Thanks in advance. Quote Link to comment https://forums.phpfreaks.com/topic/70187-unix-vs-iis/ Share on other sites More sharing options...
rarebit Posted September 21, 2007 Share Posted September 21, 2007 Have you put the data in? Quote Link to comment https://forums.phpfreaks.com/topic/70187-unix-vs-iis/#findComment-352524 Share on other sites More sharing options...
phpgroopie Posted September 21, 2007 Author Share Posted September 21, 2007 Sure did. When the code that was written does a mysql_select_db it does not seem to get access. Even when I use the root user to authenticate. Quote Link to comment https://forums.phpfreaks.com/topic/70187-unix-vs-iis/#findComment-352532 Share on other sites More sharing options...
rarebit Posted September 21, 2007 Share Posted September 21, 2007 There's your problem then, do a test page and play with the details until correct... Why use 'root' user, what user have you granted privileges to? Quote Link to comment https://forums.phpfreaks.com/topic/70187-unix-vs-iis/#findComment-352537 Share on other sites More sharing options...
phpgroopie Posted September 21, 2007 Author Share Posted September 21, 2007 I recognize that the problem is at the connection point with the DB. I was just using root as a test when the other users ID I had setup, which has all priviledges, would not work. My concern is that this was orginally developed on a UNIX box. My only question is, "Is the PHP code different for pages developed on UNIX than if it was developed on an IIS box?" They do not want me to take the time to change the code on all of the webpages that this other company developed for them if that is what it is going to take to make it work on IIS. They would rather go back to the other company and tell them to fix it under their original contract with them. Quote Link to comment https://forums.phpfreaks.com/topic/70187-unix-vs-iis/#findComment-352548 Share on other sites More sharing options...
rarebit Posted September 21, 2007 Share Posted September 21, 2007 As far as i'm aware both the php and mysql should operate exactly the same... But pls don't quote me! (e.g. i've never had any probs... sounds like a connection prob! Check user, host, password, db name... Obvious I know but REALLY make sure, recopy across etc...) Quote Link to comment https://forums.phpfreaks.com/topic/70187-unix-vs-iis/#findComment-352552 Share on other sites More sharing options...
effigy Posted September 21, 2007 Share Posted September 21, 2007 It sounds like your MySQL permissions are not set up properly. My only question is, "Is the PHP code different for pages developed on UNIX than if it was developed on an IIS box?" Only if they used non-portable code. All of the MySQL functionality should be the same as long as the versions are. Quote Link to comment https://forums.phpfreaks.com/topic/70187-unix-vs-iis/#findComment-352554 Share on other sites More sharing options...
phpgroopie Posted September 21, 2007 Author Share Posted September 21, 2007 The mysql version on the IIS box is 5 and the UNIX development box was 4. So looks like that may be part of the problem. Not 100% about the current PHP version as I do not have it in front of me but the original was 5.0.4 What is non-portable code? The reason I ask is that I was able to make a few changes to the code and get the mysql_connect statement to work. Original <? $dbclns = @mysql_connect....etc. Change to: <?php $dbclns = @mysql_connect....etc. So would the above indicate non-portable code or differences between mySQL versions. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/70187-unix-vs-iis/#findComment-352560 Share on other sites More sharing options...
rarebit Posted September 21, 2007 Share Posted September 21, 2007 That's something to do with some setting in php.ini, I always use full tags anyway! Quote Link to comment https://forums.phpfreaks.com/topic/70187-unix-vs-iis/#findComment-352562 Share on other sites More sharing options...
effigy Posted September 21, 2007 Share Posted September 21, 2007 That would be a configuration issue, not a portability issue. A portability issue, for example, would be moving COM code from Windows to Unix, or Unix commands to Windows, such as $files = `ls`. Quote Link to comment https://forums.phpfreaks.com/topic/70187-unix-vs-iis/#findComment-352564 Share on other sites More sharing options...
phpgroopie Posted September 21, 2007 Author Share Posted September 21, 2007 OK.....I know you guys are flying somewhat blind but do I have to worry about the version mismatch or is it just the configuration of the php.ini file? Quote Link to comment https://forums.phpfreaks.com/topic/70187-unix-vs-iis/#findComment-352577 Share on other sites More sharing options...
effigy Posted September 21, 2007 Share Posted September 21, 2007 If the website displays, the PHP tags are not the issue. Can you login into MySQL at the command line? Quote Link to comment https://forums.phpfreaks.com/topic/70187-unix-vs-iis/#findComment-352578 Share on other sites More sharing options...
phpgroopie Posted September 21, 2007 Author Share Posted September 21, 2007 The website displays fine with the exception of the db content. Unfortunately the server is at the client site so I have no access right now. If you have some suggestions on things to check though that would be awsome. Quote Link to comment https://forums.phpfreaks.com/topic/70187-unix-vs-iis/#findComment-352582 Share on other sites More sharing options...
effigy Posted September 21, 2007 Share Posted September 21, 2007 MySQL user accounts, passwords, and permissions. Also, make sure you're error checking everything as well (the "@" you used in your previous example is a bad idea). Quote Link to comment https://forums.phpfreaks.com/topic/70187-unix-vs-iis/#findComment-352595 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.