Jump to content

Soumikbhat

Members
  • Posts

    12
  • Joined

  • Last visited

Posts posted by Soumikbhat

  1. <?php
    $servername = "localhost";
    $username = "user";
    $password = "pass";
    $dbname = "db_name";
    $conn = new mysqli($servername, $username, $password, $dbname);
    // Check connection
    if ($conn->connect_error) {
       echo "connection problem";
       //die("Connection failed: " . $conn->connect_error);
    }
    

     

    This is the code of this page on my website. Until last week everything seemed to be working fine. But recently I'm getting an error message,

    Warning: mysqli::mysqli(): (HY000/2002): No such file or directory in /home/soumik/public_html/dbconnect.php

     

    What happened suddenly to cause this error? The user exists for the respective database, and all was fine till last week, and I haven't made any changes in my code either.

     

    The problem got away on replacing localhost with 127.0.0.1 <_<

  2. It isn't registered anymore. Dot tk is notorious for randomly canceling people's domains without notice (and sometimes demanding payment to get it back.) I lost 3 tk domains that way, gave up and bought a .com and never looked back. Their own whois service shows that they cancelled it on you (and they seem to ignore support requests unless its for issues with giving them money...). Sometimes you can re-register it, sometimes you can't. Try registering again, and if it says "already taken" then you'll need a new domain. From their site:
    Your selected domain name is a domain name that has been cancelled, suspended, refused or reserved at the Dot TK Registry.
    Your account looks fine on our end. You need a new domain. Once you get a new domain, you can change your main domain using the script on our website, or you can post it here and I can change it for you.

     

    Can my account be changed to any free domain name that heliohost may offer? Any extension will do, like

    soumikbhat.<whatever_extension_you_guys_support> ? Thanks for the help.

  3. That domain is not registered. You need to register that domain on dot.tk's website and specify "custom nameservers" of ns1.heliohost.org and ns2.heliohost.org. Your hosting account soumik is active on Johnny and should be working. Even though your website won't work until you register the domain, set the nameservers, and wait 24-48 hours, you should be able to log into your control panel through the form on heliohost.org. Finally, not receiving any email is quite normal. Many email providers discard our email without delivering it, or flag it as spam. Gmail usually flags us as spam, so check in your spam folder for the welcome email.

     

    The domain is already registered. I myself had registered it and had the site running over here since the last 5 months. Suddenly this happened.

  4. You could pass the data as GET or POST data if your Python script receives web requests (PHP can do a file_get_contents or cURL request with GET/POST arguments, the function will return Python's output in PHP so you can get the results). Passing them on the server side with things like passthru or exec won't work though. We don't allow those functions here. There's not many reasons to use both though. Perhaps write the program all in one language?

     

    &--#60;?php
    $a="hello world";
    $o = passthru("python a.py ".$a);
    echo $o;
    ?&--#62;
    

     

    This is my simple php code which I am using to test. My python code is

    #!/usr/bin/python
    import sys
    print "Content-Type: text/html\n\n";
    s= "Hello world from python"
    print s
    #print sys.argv[1]
    return s
    

     

    Can you please tweak this so that it becomes a bit clearer what exactly you're saying..?

    Sorry am a beginner so a bit clueless on this..

     

    As far as I know, GET/POST is used to get the values in php, but I want my python script to work with the variables from the php script. That's where I'm stuck. How do I have my Python file to read those variables?

     

    EDIT : Got it to work...thanks

  5. Hello, I am using Heliohost's free hosting, I want to know how exactly to deploy python over here..I have never done that in the past. For instance, suppose I have a simple a.py file with a simple print "Hello world" - where do I exactly put it? I tried putting it in cgi-bin and trying <my-domain>/cgi-bin/a.py but got an Internal Server Error.

     

    Any help would be appreciated.

×
×
  • Create New...