Community Forums

Discuss, share and get help from our community of friendly WHMCS users

Close
Login to Your Account
Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2017
    Posts
    2

    Default Setting licensed public IP inside configuration.php

    Hi!

    I'm running WHMCS inside a container and passing the license key, db connection and all the other necessary info via environment variables. However, since upgrading the container image to use WHMCS v7.x.x I can no longer set licensed public ip in configuration.php.

    Here's a workaround that I've been using in whmcs v6:

    PHP Code:
    ... (configuration.php) ...

    if(
    getenv('LICENSED_PUBLIC_IP'))
    {
            
    $_SERVER['SERVER_ADDR'] = getenv('LICENSED_PUBLIC_IP');

    In v7 this results in an "INVALID LICENSE" error whenever I upgrade the container. It's because WHMCS uses container's internal IP address instead of the public IP given in the file above.
    I'd be grateful for any clues on how to solve this problem.

    Cheers

  2. #2
    Join Date
    Oct 2006
    Posts
    3,434

    Default Re: Setting licensed public IP inside configuration.php

    Why should that even work? Wouldn't something like this allow the possibility of faking the actual installation is licensed (not saying you are)? I mean, if you can tell it what IP to use, what's to stop you doing that for more than one installation using a licensed IP...

  3. #3
    Join Date
    Jun 2017
    Posts
    2

    Default Re: Setting licensed public IP inside configuration.php

    Running it inside a container is the main thing here. WHMCS takes the internal ip of the container that it is running in and treats it like the public address that would be used for accessing the panel from the Internet. The workaround for the containerized IP address that I posted worked fine on whmcs v6, and as far as I remember, whmcs support gave us this solution when we asked them about it.

    I mean, if you can tell it what IP to use, what's to stop you doing that for more than one installation using a licensed IP...
    Doesn't the address have to match with the license number? I assume (the obvious) that you cannot use a license for more than one installation, so I don't understand your concerns here.

  4. #4
    Join Date
    Oct 2006
    Posts
    3,434

    Default Re: Setting licensed public IP inside configuration.php

    Quote Originally Posted by vane41 View Post
    as far as I remember, whmcs support gave us this solution when we asked them about it.
    If they provided it, they must know about it so I withdraw the concern.
    Doesn't the address have to match with the license number? I assume (the obvious) that you cannot use a license for more than one installation, so I don't understand your concerns here.
    Just playing devil's advocate here, but let's say I create 5 containers. In each, I use a WHMCS installation with that same IP listed along with the key, etc. Unless there is some mechanism at their licensing server that would pick up on it, license A on IP A would work on *every* instance of that IP and license...
    Maybe.

Similar Threads

  1. Setting permissions of WHMCS configuration file
    By domainkiosk in forum Using WHMCS
    Replies: 3
    Last Post: 11-01-16, 10:06 PM
  2. Replies: 1
    Last Post: 09-28-12, 05:53 PM
  3. PHP Inside TPL Files
    By hyder7nh in forum Developer Corner
    Replies: 5
    Last Post: 12-24-11, 04:11 PM
  4. Using smarty code inside PHP?
    By zomex in forum Developer Corner
    Replies: 8
    Last Post: 03-01-11, 08:11 AM
  5. How to include a php file inside tpl
    By vertigos in forum Developer Corner
    Replies: 8
    Last Post: 01-09-09, 12:14 PM

Posting Permissions

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