• GoDaddy Community
  • VPS & Dedicated Servers
  • VPS & Dedicated Servers

    cancel
    Showing results for 
    Show  only  | Search instead for 
    Did you mean: 
    New

    Problems with PHP extesnions; JSON and GMP

    Godaddy recently had me move from classic hosting to a CPanel account because they are retiring some servers. I had no problem with moving but now I'm running into a problem with PHP versions and extensions.

    I changed my PHP version from 5.4 (native) to 5.5. This caused any code that uses the PHP's JSON extension to break so that I was getting error messages stating that functions like json_decode do not exist. I did some searching with Google and discovered that there are licensing issues with JSON in PHP 5.5. Switching back to 5.4 (native) fixes this but then causes another problem. The GMP math extension is not included is 5.4 (native), this breaks some of my other code. If I switch to 5.4 (not native) I can then manually add the GMP extension in php.ini and my GMP code then works, but JSON is once again broken. I tried adding the JSON extension both through CPanel and in php.ini but it doesn't work.

    So currently I'm forced to choose between using JSON or GMP. I can apparently have one or the other, but not both. This is not acceptable. Am I doing something wrong or does this need to be fixed by Godaddy?

    5 REPLIES 5
    Community Manager

    Hi @DavidM

     

    I'm not sure what would cause this. I was able to confirm that both PHP 5.5 and 5.4 have JSON and GMP enabled by default on a test cPanel account. A php info script showed that both of these were enabled. Perhaps if you add some additional details like links to pages where an error is occurring, other members of the Community with more coding experience can help further.

     

    JesseW - GoDaddy | Community Manager | 24/7 support available at x.co/247support | Remember to choose a solution and give kudos.

    This address shows a gmp undefined error message: http://www.mottern.com/projecteuler/Problem3/?product=600851475143

    The source can be seen at this address: http://www.mottern.com/projecteuler/Problem3/?show_source

    This is not a coding issue. It ran fine on my old Godaddy classic hosting account and it runs fine in Wamp on my windows machine.

    The PHP version is currently set to 5.4 (native), and JSON works but the PHP gmp library is not recognized as being present.

    You can see code successfully using JSON here: http://www.mottern.com/maps/

    Hello DavidM,

    Has this been resolved?

    Will you please post the resolution since I'm facing the same issue with json_decode() on PHP 5.6 and can't afford to go back to 5.4

     

    Thank you!!

    mpols

    Hello,

    How can I manually add the GMP extension in php.ini?

    Please help.

    Awaiting your reply.

     

    www.stormtrackerwx.com/index_beta.html

     

    I am am attempting to call a local JSON file asynchronously, using ajax and the $.getJSON method to display information in a Google Maps window, when a user clicks a marker.

     

    This works fine in a console, but does not display when embedded in my web page.  I am currently using cPanel to manage the site.  Is there something internal I may be missing?

     

    Thank you!