PHP Client for Integrating to NoIP.com
Client to update the DDNS hostname to a specific IP., (*1)
see http://www.noip.com/integrate/request, (*2)
Installation
Install as globally executable script
wget https://github.com/buonzz-systems/noip/raw/master/dist/noip_php.phar
sudo mv noip_php.phar /usr/local/bin/noip_php
chmod +x /usr/local/bin/noip_php
noip_php -V
Place a configuration file named ".env" on home folder with the following contents:, (*3)
NOIP_HOST=yourhost.ddns.net
NOIP_USERNAME=yourusername
NOIP_PASSWORD=yourpassword
Running as cron job every 4 hours
0 */4 * * * cd ~;/usr/local/bin/noip_php client:update
Install via Composer in a Project
composer require buonzz/noip
Create the configuration file with filename .env, (*4)
vi .env
The config file should contain this variables that you need to set, (*5)
- NOIP_HOST - is your NoIP Hostname, (e.g. myhostname.ddns.net )
- NOIP_USERNAME - your account username
- NOIP_PASSWORD - your password
Remember to not commit the .env file to your git repository! These variables is automatically loaded by app as environment variable. This is a security feature so that your credentials is not hardcoded in your application source codes., (*6)
Instantiate Client and set IP, (*7)
use Buonzz\NoIP\Client;
$client = new Buonzz\NoIP\Client();
$result = $client->update("1.1.1.1");
if($result == 'OK')
// the ddns host is successfully updated
Install it as CLI script
You can install it globally in your machine:, (*8)
composer global require buonzz/noip
Simply add this directory to your PATH in your ~/.bash_profile (and/or ~/.bashrc) like this:, (*9)
export PATH=~/.composer/vendor/bin:$PATH
load the current config, (*10)
source ~/.bash_profile
Set the .env file in, (*11)
~/.env folder, (*12)
vi ~/.env
(look at the above section for configuring projects to know what vars is required ), (*13)
Now you are ready to run the script, (*14)
noip_php client:update
Phar Build
https://gist.github.com/buonzz/07193b92ee10e9eaac19 first box in your Homestead., (*15)
box build
```, (*16)