Zubrag.com
September 19, 2019, 11:58:20 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: cpanel_create_db.php  (Read 5547 times)
dcroose
Newbie
*
Posts: 3


« on: September 09, 2009, 09:53:15 PM »

Hi All,
I am a 73 year young retired computer systems engineer.  Been retired for a number of years so my programming skills are rusty to say the least.  I am trying to teach myself php and at the same time use my new knowledge to create a web site to my liking.  I want to be able to create a database from script so when I found cpanel_create_db.php I was delighted.  But, I cannot get it to work.  A little help would be appreciated. 

I think that the below listed lines should be the only thing I need to change in order to create a database on my server.  The below list shows the values I have entered (exceptfor the passwords).

// cPanel username (you use to login to cPanel)
$cpanel_user = "ahventur";

// cPanel password (you use to login to cPanel)
$cpanel_password = "******";

// cPanel domain (example: mysite.com)
$cpanel_host = "amazinghomeventures.com";

// cPanel theme/skin, usually "x"
// Check http://www.zubrag.com/articles/determine-cpanel-skin.php
// to know it for sure
$cpanel_skin = "x";

// Script will add user to database if these values are not empty
// User wil have ALL permissions
$db_username = 'dick';
$db_userpass = '********';

// Update this only if you are experienced user or if script does not work
// Path to cURL on your server. Usually /usr/bin/curl
$curl_path = "";

The rest of the code remains unchanged from the download.

When I run the script using the following command line in my browser:

http://www.amazinghomeventures.com/user/cpanel_create_db.php?db=Testdb&user=ahventur&pass=********

I get the following error returns:

Warning: file_get_contents(http://...@amazinghomeventures.com:2082/frontend/x/sql/adddb.html?db='Testdb') [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in /home/ahventur/public_html/user/cpanel_create_db.php on line 43

Warning: file_get_contents(http://...@amazinghomeventures.com:2082/frontend/x/sql/adduser.html?user=ahventur&pass=x6SXzJEQ) [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in /home/ahventur/public_html/user/cpanel_create_db.php on line 43

Warning: file_get_contents(http://...@amazinghomeventures.com:2082/frontend/x/sql/addusertodb.html?user=ahventur_ahventur&db=ahventur_'Testdb'&ALL=ALL) [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in /home/ahventur/public_html/user/cpanel_create_db.php on line 43

Any help in getting this working would be appreciated.

Thanks
dcroose

Logged
dcroose
Newbie
*
Posts: 3


« Reply #1 on: September 11, 2009, 01:07:43 PM »

Hi all,
I found out the problem is with my host, I need a dedicated server in order to create databases from code.
Thanks
dcroose
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC