Results 1 to 17 of 17
  1. #1

    PHP Script not working at New Host

    Script worked fine at my previous host but is not working now on my new VPS.

    Hoping somebody will share some thoughts -

    Could it be different versions of PHP between the two hosting cos?

    On a whim I turned ON register_globals but that didn't help

    I can post the code here in the thread if anybody wants to help - its a blank referrer and link randomizer, in 2 parts.

    I have a managed VPS (VPS Latch and they've been great so far) with cPanel/fantastico.

  2. #2
    Join Date
    Oct 2006
    Location
    canada
    Posts
    527
    When you say it doesn't work, is there an error in the error log? Or on the screen if you have display errors enabled (you shouldn't)?

    What version PHP was the old host running as opposed to your new one?

    Have you tried just asking VPSLatch to look at it since they are managed and may do it?
    What did you expect was going to happen?
    6sync is where I've made my home ): // @tenkay

  3. #3
    Join Date
    Jun 2008
    Location
    In Dreams
    Posts
    659
    why dont yo contact them directly?
    their support is top notch and they should be able to help....
    just open a ticket hit some keys and your solution ll be there after a few mins.....
    thats what VPSLatch is known for

  4. #4
    Yes there service has been great no doubt.

    I did contact them directly. They did tell me though that I should speak to a programmer, acknowledged that it could be a php version issue and again, to speak with a programmer.

    I don't know what php version my prior was running but it was hostgator and it was about 8 months ago. As far as I know VPS LAtch is running PHP 5.

    As for error messages its strange - when I run the script on one domain and try to view that domain in my browser I get "can't find the server" error, but when I run the same script on a second domain (on the same VPS) I get this unusual file download window with a http php5 file (I think its an octet file).

    I haven't looked at error logs; probably just Chinese to me.

  5. #5
    Join Date
    Oct 2006
    Location
    canada
    Posts
    527
    Quote Originally Posted by Ruchka View Post
    when I run the script on one domain and try to view that domain in my browser I get "can't find the server" error, but when I run the same script on a second domain (on the same VPS) I get this unusual file download window with a http php5 file (I think its an octet file)
    This sounds more like whatever is attempting to server the PHP file is misconfigured than the PHP file/PHP version itself.

    Can you get a simple PHPinfo file to work?
    What did you expect was going to happen?
    6sync is where I've made my home ): // @tenkay

  6. #6
    Join Date
    Oct 2003
    Location
    Morocco
    Posts
    549
    Try to rename any .htaccess files on your public_html folder.

    Also check if there is any error_log files there and post the content here.
    RofyHost - Affordable Shared & Reseller Hosting Since 2003
    Proud Moroccan

  7. #7
    Quote Originally Posted by Can you get a simple [URL="http://docs.simplemachines.org/index.php?topic=479.0"
    PHPinfo[/URL] file to work?
    Followed those instructions on a third domain on the VPS (as yet untouched by me), and get the same result in my browser as before adding the phpinfo file:

    Index of /
    * cgi-bin/
    * images/
    * moving.page/
    * phpinfo.php
    * postinfo.html
    * suspended.page/

  8. #8
    Join Date
    Oct 2006
    Location
    canada
    Posts
    527
    Quote Originally Posted by Ruchka View Post
    Followed those instructions on a third domain on the VPS (as yet untouched by me), and get the same result in my browser as before adding the phpinfo file
    Talk to VPSLatch again, something is wrong in the server/VPS setup if it can't open a simple phpinfo file properly.
    What did you expect was going to happen?
    6sync is where I've made my home ): // @tenkay

  9. #9
    Quote Originally Posted by RofyHost View Post
    Try to rename any .htaccess files on your public_html folder.

    Also check if there is any error_log files there and post the content here.
    Ok I looked at the error log and this is the most recent message:

    [Tue Mar 01 21:07:05 2011] [error] [client xxx.xxx.xxx.xxx] File does not exist: /home/MyUserName/public_html/404.shtml
    [Tue Mar 01 21:07:05 2011] [error] [client xxx.xxx.xxx.xxx] File does not exist: /home/MyUserName/public_html/favicon.ico


    All the other error messages look like this:

    [Tue Mar 01 21:07:04 2011] [error] [client xxx.xxx.xxx.xxx] File does not exist: /home/MyUserName/public_html/404.shtml
    [Tue Mar 01 21:07:04 2011] [error] [client xxx.xxx.xxx.xxx] File does not exist: /home/MyUserName/public_html/www.google.com


    But ALSO I noticed in the error log a client IP that is not mine, its some IP from Mumbai WTF??

    This just got weirder.

  10. #10
    Quote Originally Posted by dyna! View Post
    Talk to VPSLatch again, something is wrong in the server/VPS setup if it can't open a simple phpinfo file properly.
    Thanks Have written support explaining this and am waiting their reply.

  11. #11
    Join Date
    Oct 2003
    Location
    Morocco
    Posts
    549
    moving.page/ indicates that you used cpanel account transfer, did you check if your domain is really pointing to the correct VPS server IP address ?
    RofyHost - Affordable Shared & Reseller Hosting Since 2003
    Proud Moroccan

  12. #12
    Quote Originally Posted by RofyHost View Post
    moving.page/ indicates that you used cpanel account transfer, did you check if your domain is really pointing to the correct VPS server IP address ?
    No I didn't check that. This is a new domain new hosting, and the hoster has managed the process to this point. I didn't transfer anything. Not sure how to check if the domain is pointing correctly.

  13. #13
    Join Date
    Oct 2003
    Location
    Morocco
    Posts
    549
    you can use any whois service such as www.whois.sc or www.centralops.net to check if your domain name is pointing to the correct IP address assigned by your host in your welcome email.
    RofyHost - Affordable Shared & Reseller Hosting Since 2003
    Proud Moroccan

  14. #14
    Ah ok thanks. Yes all 3 new domains are pointed at the right nameserver as far as I can tell.

    Alright so even though my phpinfo file did not work the support staff created a simple php file, loaded it and it worked fine. Not sure why that is, but ok.

    As for my php script there WAS an error in the rotator script (I added a http:// to the destination url) so it works now, BUT

    it is only working in one domain and not the other 2 domains so I've asked support to check into it.

    Hopefully this is nearly fixed.

  15. #15
    Join Date
    Feb 2011
    Posts
    38
    Sounds like a host error. PHP scripts and things like rotators, when referencing images, should be using relative links and not absolute.

    src="./images/slide1.png" should be used instead of src="host.com/images/slide1.png"

    PHP files not working and causing a popup would be due to a server config issue, as the server is not recognizing it as a server-parsed file.
    404 errors would come from bad PHP code (really bad code) or htaccess rewrite/redirect problems.

  16. #16
    The matter is now resolved.

    Support told me to "flush my DNS" and after a restart now everything is working fine.

    My thanks for all your help.

  17. #17
    Join Date
    Jun 2003
    Location
    California
    Posts
    2,766
    Quote Originally Posted by RofyHost View Post
    you can use any whois service such as www.whois.sc or www.centralops.net to check if your domain name is pointing to the correct IP address assigned by your host in your welcome email.
    This works to tell you if the top level domain DNS servers are pointing toward your domain correctly, but doesn't tell you if your local DNS server at any level between you and the top level servers is updated.

    To see if YOUR connection is updated just ping your domain name (in Windows, "Start" * "Run" * CMD and then type "ping yourdomain.com" in the DOS box and note the IP address).

    If it hasn't resolved for your local connection, you can type "ipconfig /flushdns" in that same DOS window to flush your computer's DNS cache. Then, ping the domain name again. If the DNS still has not resolved, you need to wait until the local DNS server updates.

    You can also use your local HOSTS file to force your computer to look at the correct IP address.

Similar Threads

  1. Simple php script not working after transfering host
    By gariben in forum Software & Scripts Requests
    Replies: 2
    Last Post: 08-27-2008, 03:24 PM
  2. PHP script no longer working
    By Yappi in forum Programming Discussion
    Replies: 5
    Last Post: 02-07-2008, 09:46 AM
  3. Simple PHP Script Not Working
    By EssEss in forum Programming Discussion
    Replies: 3
    Last Post: 04-23-2006, 02:52 PM
  4. PHP script not working
    By Wapture in forum Hosting Security and Technology
    Replies: 1
    Last Post: 06-29-2004, 12:45 PM
  5. Php counter script not working...
    By Jestah in forum Other Offers & Requests
    Replies: 2
    Last Post: 06-12-2003, 03:42 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •