Hi,

On our network we have a Windows 2000 server running Apache 2.0.52, MySQL 4.1 and PHP (not sure which version off the top of my head. Not sure that it's relevant to this query either!).

The problem is that one user in particular cannot access any php pages stored on the server. Every other user on our network has no problems at all accessing PHPMyAdmin etc, but this one user cannot. He's tried using Firefox, IE etc and none of them work. He gets a small snippet of the code of the page he is trying to view displaying as text in his browser. It has worked on his computer before so I am stumped. He denies installing any fresh software but a quick check shows that he has recently installed FileZilla and Firefox 1.0.3, but I can't see either of those causing a problem.

Does anyone have any suggestions?

Thanks in advance.

Phil

    well it cant be a php issue, as by the time the pages get to the client they are just html. and php / apache aren't even aware of such a thing as a browser.

    still doesnt help you with your issue, but i would be looking at the client. maybe a firewall issue or something.

    on a side note. you say your running 'a Windows 2000 server' with apache. does this meen you also have iis running? or your just running on the 'server' version of 2k, without iis running.

    if you are running iis and apache on the same machine, make sure they are listening on different ports, otherwise both sevrers will try to serve the requested file, and both will fail.

      Thanks very much for the quick response.

      I'd come to the same conclusion as you. The PHP server is running fine. There aren't any errors logged on it and I've tried from 6 or 7 other computers with various browsers and OS and had no problems at all. I fear this may be down to the users obsessive lust for downloading patches and updates. I'm loathe to do a system restore but I think it may come down to that.

      The only thing that I can think of is that he has also installed Dreamweaver MX 2004 on his computer and has since changed the default application for .php files to Mozilla Firefox. He doesn't have any problems with php files on the web bizarrely.

      Thanks again and any further professional light shedding would be appreciated.

      PS: IIS is disabled on the server.

        he has also installed Dreamweaver MX 2004 on his computer and has since changed the default application for .php files to Mozilla Firefox

        i would get the default application fro .php files et back to dreamweaver (or even notepad), but this shouldn't be causing a problem.

        can the client get to a html file on the server?

          Yep. Do you use PHPMyAdmin? If it's any help, it displays this code (hope this displays right!!!):

          urldecode the db name if (isset($lightm_db)) { // no longer urlencoded because of html entities in the db name // $db = urldecode($lightm_db); $db = $lightm_db; unset($lightm_db); } $url_query = PMA_generate_common_url(isset($db) ? $db : ''); header('Content-Type: text/html; charset=' . $GLOBALS['charset']); require_once('./libraries/relation.lib.php'); $cfgRelation = PMA_getRelationsParam(); if ($cfg['QueryHistoryDB'] && $cfgRelation['historywork']) { PMA_purgeHistory($cfg['Server']['user']); } $phpmain_hash = md5($cfg['PmaAbsoluteUri']); $phpmain_hash_js = time(); ?> 0) { PMA_availableDatabases(); // this function is defined in "common.lib.php" } else { $num_dbs = 0; } if ($num_dbs > 1) { if ($cfg['LeftFrameLight']) { $query_frame_height += 20; } } if ($cfg['QueryFrame']) { / Will we show list of servers? / if ($cfg['LeftDisplayServers'] && $cfg['DisplayServersList'] && count($cfg['Servers']) > 1) { $query_frame_height += (count($cfg['Servers']) + 1)*15; } if ($cfg['QueryFrameJS']) { echo ' ' . "\n"; echo "\n"; echo '

          This is from the page "index.php" in PHPMyAdmin. The preceding lines are a few REM comments (pardon my use of BASIC terminology) as follows:

          /**
          Defines the frameset
          /
          // loic1: If left light mode ->

          The text that is displayed follows on directly from the last line.

            12 days later

            Just bumping this up again, as I still haven't solved it.

              are you saying that the user with the problem actually sees raw PHP code? The PHPMyAdmin snippet you've included is raw PHP code. Is that what the user sees on their client??

              That's a majorly serious concern, and points to a fix on the server side. The server shouldn't be distributing any PHP code - only the HTML it generates.

              The only rational explanation I can think of is that the client's requests are somehow goign through to a different webserver to everyone else's, and that web server has not been configured properly for php, so it's just displaying the php.

              You can check this by watching the server logs. When the problem client tries to access the page, does that request get server from the live server?

              If not - check the client's connection settings. Are they using the same proxy settings as everyone else? What about the hosts file, any funny mappings in there? What could be routing the request to a different server / port?

                I can't help but think that the server itself is just fine here, since you've said you have no problems with other clients.

                I would look at the client's machine. I would even look at toasting it and formatting it (or ghost it, if you have that option).

                  Originally posted by bradgrafelman
                  I can't help but think that the server itself is just fine here, since you've said you have no problems with other clients.

                  But a client PC can't somehow display raw PHP unless the server is passing it on uninterpreted.

                  My money is still on some client setting (proxy, hosts...) which is causing it to direct the request to a different server which is not configured for PHP.

                  I wonder if we can get a bookie to start taking bets on this? 🙂

                    lol.. too true.

                    Another suggestion I was going to say, was use a telnet client (MS's from DOS which I don't like, OR PuTTY) to actually telnet into the webserver's port, and do a:

                    GET /phpmyadmin/index.php HTTP/1.0

                    and see what it outputs. But yeah, I'm thinking that proxy settings might be playing a role here. Maybe there's a wrong IP in the computer's HOSTS file too? I'm just grasping and any and all possible culprits here... there's tons to choose from... 90% of them on the client side.

                      Originally posted by bradgrafelman
                      lol.. too true.

                      Another suggestion I was going to say, was use a telnet client (MS's from DOS which I don't like, OR PuTTY) to actually telnet into the webserver's port, and do a:

                      GET /phpmyadmin/index.php HTTP/1.0

                      and see what it outputs.

                      If you're after the headers going back and forth - I note that one of the clients being tested is Firefox - then (temporarily) installing the Livehttpheaders would also net these.

                      And I guess you could ping the host to see which address the domain name is being resolved to.

                      In both cases the results would need to be compared with those from a working client.

                        Thanks for your replies guys. I'm not sure that a domain name resolution is the issue as the server is actually on the domain and not on the Internet. The user and the server are on the same subnet and it's the only web server on the network. I haven't checked the routing, but I'm guessing that since it's pulling a portion of the file that it's routing to the correct servers.

                        I will definately check the hosts, headers and proxy server settings though.

                        Oh, and one of you highlighted Firefox for whatever reason. He has just upgraded to the latest version. Has anyone heard of any php issues with it?

                          Has anyone heard of any php issues with it?

                          The reason Firefox was mentioned was that you can get aLiveHTTPHeaders extension for it which might serve to shed more light on this.

                          However, no matter what client software you use - Internet Explorer, Opera, Mozilla, Firefox, telnet... none of these can instruct your server to not interpret the PHP.

                          From the problem PC, do you browse the pagesusing IP address or a name?

                            No, we use name, but the resolution is no problem. I've made a front page on the webserver which is purely html with a bunch of links. The user can get to that with no problems. It can't be a networking or server issue surely. It has to be something which functions in IE and Firefox causing it not to work.

                              Originally posted by DirtySanchez
                              No, we use name, but the resolution is no problem.

                              So you've verified that the IP the name is being resolved to is the same for the user with the wonky results as it is for everyone else? That the broken page really is coming from the same code as the one that works for everyone else (they're not using a broken install of PHPMyAdmin that's floating around somewhere?)?

                              I am assuming that you've cleared all the caches that might possibly be involved, and that the bad page really is being generated on request.

                                To the best of my knowledge yes. I've been using my PC as a test bed, as I have the same version of Windows, IE, Firefox etc. The same happens on the user's computer if he uses the IP address rather than the DNS name. I've cleared the cache, cookies etc from the user's PC and it makes no differance.

                                  Originally posted by DirtySanchez
                                  It has to be something which functions in IE and Firefox causing it not to work.

                                  I strongly disagree. The webserver interprets php and produces html. Either the webserver is doing that, or it isn't.

                                  There is no way for the client PC to display raw PHP unless the webserver isn't doing its job properly.

                                  There isn't anything you can set in IE, FireFox or anything else to tell the webserver not to do what the server administrator has configured it to do.

                                  If there was, it would be a major exploit and could be used to extract passwords etc from commercial sites.

                                  If you type a url into your PC and see raw php, there are a few of possibilities.

                                  -. the webserver is not configured for PHP
                                  -. the webserver is not configured to interpret the particlar file type as PHP
                                  -. either 1 or 2 is simulated beacuse you're not getting through to the webserver which you think you are.

                                  To figure out what's going on, try these simple steps:

                                  1. Create a new file called xinfo.php containing just php_info. I don't care if you've already got one. Create a new one:
                                  <?php
                                  php_info();
                                  ?>
                                  
                                  1. Try to access this file from the problem PC.

                                  If you get a 404 File not found error, you must be connecting to a different server to the one you created the file on. Check the client's network setup, routing, caching, hosts file etc

                                  If you see exactly the above, then the webserver didn't recognise that the file was to be interpreted as php. Check the webserver config.

                                  If the above works perfectly, but you still see php code when you try to access phpmyadmin, doublecheck the suffix of the phpmyadmin file you are trying to access, rename xinfo.php to match it and rerun the test.

                                    I already have the PHPinfo script on the webserver. It displays absolutely nothing on the users computer.

                                    I see the point you are making but going by the fact that the webserver translates the page correctly for every single other computer I have tried it on suggests that it is working fine. Would this be a fair assumption?

                                    As you've probably figured out, my knowledge of running a webserver is sketchy at best, but there appears to be no logical explanation for this!!!

                                      the point about creating a new one was that it would confirm that the user was definitely connecting to the correct server. Go on 🙂 create a new file.