skip to Main Content

I try running a php script on a external server and hosting. I selected byethost because it’s a free service. All my system run excellent, except this script. I search information and i not found anything.

exec('mysqldump -u useronserver -ppasswordonserver clinicasbv >' . RESPALDOS_DB_L . date('Y_m_d_g_i_s', time() - (21600 - 3600)) . '_clinicasbv_backup.sql');

This code working perfect on my virtual host in my machine, but not work in byethost.

So, i need a root privileges or anything for running this script in a
external server? I need this script working on a external server, it’s all

2

Answers


  1. To do this, the connecting host will preferably need a static IP address otherwise you’ll need to re-do this guide each time their dynamic IP address from their ISP changes.
    You can allow access from cPanel for MySQL itself. We’ll also need to setup an allow rule through the firewall which is covered here.

    1. Login to your cPanel.
    2. Go to Databases » Remote MySQL.
    3. Enter the IP address of the computer that will be making the remote connection.
    4. Click the Add Host button.
    5. Now we need to allow the person’s IP to be able to connect to port 3306 which is closed by default. The best way to do this is with a firewall rule specific to their IP and port 3306 and how to do this for CSF is detailed here.
    Login or Signup to reply.
  2. It is very likely that the hosting provider has blocked your ability to run the "exec()" function. It is technically a security risk to allow it. You should find another way to get the MySQL dump, i.e. connecting remotely using a MySQL system or using the PHP MySQLi functions.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search