Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Synchronize Custom FTP Accounts :: API Help
#1
I'm writing an API for the OGP (Open Game Panel www.opengamepanel.org) control panel to create custom FTP users with non-standard homes.

After creating, deleting, and modifying the correct database values, I run a script called syncftp.php which contains the following:

<code>
<?php

require ("/var/www/new/ehcp/classapp.php");
$app = new Application();
$app->connectTodb(); # fill config.php with db user/pass for things to work..

$app->addDaemonOp('syncftp', '', '', '', 'sync ftp for nonstandard homes');

?>
</code>

When I run this script from the command line terminal (using php-cgi -f syncftp.php), I receive the following error:

Notice: date_default_timezone_set(): Timezone ID 'Europa/Istanbul' is invalid in /var/www/new/ehcp/classapp.php on line 194

Warning: mysql_connect(): Access denied for user 'earnolmartin'@'localhost' (using password: YES) in /var/www/new/ehcp/config/adodb/drivers/adodb-mysql.inc.php on line 365

Any idea why this is happening? Is this the correct way to call EHCP to sync the non-standard homes?

Please let me know.
~
Thanks!


Restored from old drupal forum, for user uid:2735 username:own3mall
You may reset your password to access your new account here.
Reply
#2
the first is not an error, it is a notice, just ignore it. it causes no problem.

the second one means your db user is wrong. check your config.php in ehcp dir, and fill it with right user values for mysql.
your mysql user is earnolmartin, but it cannot connect using that. you may need to reset your mysql pass for this user.

to debug, just use commandline mysql:
mysql -u earnolmartin
then, enter your pass, that is seen in config.php
if this does not work, then, your script will not work...

Restored from old drupal forum, for user uid:2735 username:own3mall
You may reset your password to access your new account here.
Reply
#3
actually, you dont need to use php-cgi,
just use php as calling program.

Restored from old drupal forum, for user uid:1 username:ehcpdeveloper
You may reset your password to access your new account here.
Reply
#4
For anyone working on an API for EHCP, your PHP script should chdir into the EHCP directory first before intializing the app class. This ensures the config.php is successfully included within the app class. You will need this for any database changes.

Here's a sample:

<code>

$curDir = getcwd();

if(chdir("/var/www/new/ehcp/")){
require ("classapp.php");

$app = new Application();
$app->connectTodb(); # fill config.php with db user/pass for things to work..

$app->addDaemonOp('syncftp', '', '', '', 'sync ftp for nonstandard homes');
}

chdir($curDir);


</code>

Hope this helps!

Restored from old drupal forum, for user uid:1 username:ehcpdeveloper
You may reset your password to access your new account here.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)

Online Shopping App
Online Shopping - E-Commerce Platform
Online Shopping - E-Commerce Platform
Feinunze Schmuck Jewelery Online Shopping