Hi!

Id like to be able to see if my other server is running.. that is.. in php i want in servre A to see if server B is up and running, without opening a page on server B!

its more like using an include.. but i tryed:

include ("http://serverB/test.php");

where test.php only does a simple echo.. (witch does work, so its not the php file)

when i tryed this i got:

Warning: Failed opening 'http://serverB/test.php' for inclusion (include_path='.:/usr/share/pear:/usr/share/php/PEAR') in /index.php on line 2

what am i doing wrong? or is there a better techniche to check if a server is alive? (like a ping command, though id prefer to check to see if the web server is running eg: test.php)

thank you!

    Try fopen'ing that page, and make sure your php.ini is configured to allow for remote files.

    Diego

      no.. it doesn't work... 🙁 i dont know about the settings since its on a webhotell.....

      any other sugestions? some body else maybe?

        Create this script in a page called phpinfo.php and place it on server b

        <?php
        phpinfo();
        ?>
        

        call server b from server a like

        readfile("http://serverb/phpinfo.php");
        

          i doesnt work! i keep getting "No such file or directory"

          witch is not true! the file is there!!! 🙁

          any other suggestions?

            What PHP version are you using, and is allow_url_fopen turned On?

            Diego

              hm.. i dont know.. since im trying to connect from my webhotell to my own server at home..

              i tryed pinging with system() it doesnt work...

                Write a Reply...