#31 (permalink)  
Old 01-26-2009, 11:37 AM
Registered User
 
Join Date: Dec 2008
Posts: 31
rongup is on a distinguished road
Is there no other way of calling MySQL functions without having to RENAME the EXTENSION. I mean addons like fantastico already have it and use it without renaming the extension
It really looks bad to have a wierd extension like .phpcp, .cpphp or livephp, .live.php

Please there got to be some other way as well like using PHPs exec(), system(), shell_exec()

ALso $CPERROR{'mysql'} is in a normal PHP file and not LivePHP
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #32 (permalink)  
Old 01-26-2009, 12:08 PM
cPanelDavidG's Avatar
cPanel Technical Sales
 
Join Date: Nov 2006
Location: Houston, TX
Posts: 8,117
cPanelDavidG is on a distinguished road
Quote:
Originally Posted by rongup View Post
Is there no other way of calling MySQL functions without having to RENAME the EXTENSION. I mean addons like fantastico already have it and use it without renaming the extension
It really looks bad to have a wierd extension like .phpcp, .cpphp or livephp, .live.php

Please there got to be some other way as well like using PHPs exec(), system(), shell_exec()

ALso $CPERROR{'mysql'} is in a normal PHP file and not LivePHP
CPError is part of the APIs, as such will not work in a regular PHP file. It needs to be a LivePHP file, .cpphp, .phpcp or called via our other APIs.

Regarding Fantastico, in my limited use of their software, it seems to be a variety of HTML front-ends that post to PHP-based back-end scripts to perform the tasks of database creation etc. If you are not creating interfaces where the page must be dynamic and generated server-side rather than client-side (e.g. with JavaScript), you may want to do something similar to that.
__________________
Need technical assistance? You can find your best avenue for support at: http://support.cPanel.net
-- cPanel David G., Lead Forum Administrator & cPanel Technical Sales Representative
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #33 (permalink)  
Old 01-26-2009, 12:39 PM
Registered User
 
Join Date: Dec 2008
Posts: 31
rongup is on a distinguished road
So there is ABSOLUTELY no way to:
1) Run CPanel API1 & 2 and PHP simultaneously
2) 1 is possible only by using the LIVE PHP framework

Ok then I can still try two methods:
a) Is it possible to execute a PHP FILE from within a PHP file using exec(), system() commands in PHP
b) Is it possible to know the exact HTTP URL the user is using to access CPanel

Also isnt :
.phpcp means php first and CP 2nd
.cpphp means cp first and PHP 2nd
then .php should mean both running simultaneously
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #34 (permalink)  
Old 01-26-2009, 12:56 PM
cPanelDavidG's Avatar
cPanel Technical Sales
 
Join Date: Nov 2006
Location: Houston, TX
Posts: 8,117
cPanelDavidG is on a distinguished road
Quote:
Originally Posted by rongup View Post
So there is ABSOLUTELY no way to:
1) Run CPanel API1 & 2 and PHP simultaneously
2) 1 is possible only by using the LIVE PHP framework
Or you could create .cpphp or .phpcp files as I mentioned above.

Quote:
Originally Posted by rongup View Post
Ok then I can still try two methods:
a) Is it possible to execute a PHP FILE from within a PHP file using exec(), system() commands in PHP
b) Is it possible to know the exact HTTP URL the user is using to access CPanel
The PHP installation for cpsrvd is not the same as the one used for Apache in many ways. First, it is a completely separate compile. Second, it runs as root. Third, it uses a separate php.ini file. This means you have full control over PHP as it is used by cpsrvd independently of the PHP used for Apache.

If you need to customize php.ini for cpsrvd, edit the following file:

/usr/local/cpanel/3rdparty/etc/php.ini

Be mindful, this PHP runs as root.


Quote:
Originally Posted by rongup View Post
Also isnt :
.phpcp means php first and CP 2nd
.cpphp means cp first and PHP 2nd
then .php should mean both running simultaneously
The .php extension means only PHP, no API1/API2 tag processing within the cPanel interface.
__________________
Need technical assistance? You can find your best avenue for support at: http://support.cPanel.net
-- cPanel David G., Lead Forum Administrator & cPanel Technical Sales Representative
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #35 (permalink)  
Old 01-27-2009, 03:55 AM
Registered User
 
Join Date: Dec 2008
Posts: 31
rongup is on a distinguished road
Can you just tell me where is the CPanel PHP Engine that parses <cpanel> tags
I can then use exec(cpanel_phpengine path to_my_script_phpcp) and get the job done
I tried the /usr/local/cpanel/3rdparty/bin/php but that is the standard PHP engine.
I need the CPANEL ENGINE

The following PHP code still gives error:
PHP Code:
echo shell_exec('/usr/local/cpanel/3rdparty/bin/php /usr/local/cpanel/base/frontend/x3/plugin/functions.live.php'); 
The error given is "There was a problem connecting back to the cpanel engine. Make sure your script is ends with .live.php or .livephp"

The file is a live.php but still no luck!
Is it because of passing it through the wrong PHP :
/usr/local/cpanel/3rdparty/bin/php

Do you have a seperate PHP binary for CPanel PHP scripts.
Please help me, I have spent over 5 days trying to figure this out.
The reason I am using exec() is that I dont want to rename my index.php to index.live.php or index.phpcp or index.cpphp

ANOTHER Thing,
Why doesnt this work in php:
shell_exec('/usr/local/cpanel/bin/mysqladmin uid ADDDB dbname');
It works if i use SSH as root admin
Even if i try to make my own PERL script it gives me an error:
-bash: line 338: /usr/local/cpanel/bin/plugin: Permission denied

Please Reply,
Rongup

Last edited by rongup; 01-27-2009 at 11:54 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #36 (permalink)  
Old 01-27-2009, 10:43 AM
cPanelDavidG's Avatar
cPanel Technical Sales
 
Join Date: Nov 2006
Location: Houston, TX
Posts: 8,117
cPanelDavidG is on a distinguished road
Quote:
Originally Posted by rongup View Post
Can you just tell me where is the CPanel PHP Engine that parses <cpanel> tags
I can then use exec(cpanel_phpengine path to_my_script_phpcp) and get the job done
I tried the /usr/local/cpanel/3rdparty/bin/php but that is the standard PHP engine.
I need the CPANEL ENGINE

The following PHP code still gives error:
PHP Code:
echo shell_exec('/usr/local/cpanel/3rdparty/bin/php /usr/local/cpanel/base/frontend/x3/plugin/functions.live.php'); 
The error given is "There was a problem connecting back to the cpanel engine. Make sure your script is ends with .live.php or .livephp"

The file is a live.php but still no luck!
Is it because of passing it through the wrong PHP :
/usr/local/cpanel/3rdparty/bin/php

Do you have a seperate PHP binary for CPanel PHP scripts.
Please help me, I have spent over 5 days trying to figure this out.
The reason I am using exec() is that I dont want to rename my index.php to index.live.php or index.phpcp or index.cpphp

ANOTHER Thing,
Why doesnt this work in php:
shell_exec('/usr/local/cpanel/bin/mysqladmin uid ADDDB dbname');
It works if i use SSH as root admin
Even if i try to make my own PERL script it gives me an error:
-bash: line 338: /usr/local/cpanel/bin/<<REMOVED>>: Permission denied

Please Reply,
Rongup
The handling of API1/API2 tags is performed by cpsrvd itself, not PHP. As a result, you cannot make any calls to the PHP interpreter itself to attempt to execute these tags that are only parsed by cpsrvd itself. The cpsrvd service knows how to process the document by means of the file extension. Therefore, if you only want to use a .php extension, you will be limited to PHP without any API1/API2.

I am not intimately familiar with command-line MySQL so I, personally, am unable to address that issue. However, feel welcome to submit a support request if you wish to pursue that issue further with the assistance of our technical analysts: http://tickets.cPanel.net/submit
__________________
Need technical assistance? You can find your best avenue for support at: http://support.cPanel.net
-- cPanel David G., Lead Forum Administrator & cPanel Technical Sales Representative

Last edited by cPanelDavidG; 01-27-2009 at 12:14 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #37 (permalink)  
Old 01-27-2009, 11:53 AM
Registered User
 
Join Date: Dec 2008
Posts: 31
rongup is on a distinguished road
I have submitted the ticket but please if you could ask someone and let me know it would be great.
I have spend days on getting this thing done but with no luck.
Please I request you to just help me with this shell execution stuff.
There are 1000s of Command Line Perl Functions within /usr/local/cpanel/bin which are all the things i require!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #38 (permalink)  
Old 02-04-2009, 08:04 AM
Registered User
 
Join Date: Dec 2008
Posts: 31
rongup is on a distinguished road
Is there a way to unzip a file using some CPanel or Perl Modules in a PHP file
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #39 (permalink)  
Old 02-04-2009, 10:16 AM
cPanelDavidG's Avatar
cPanel Technical Sales
 
Join Date: Nov 2006
Location: Houston, TX
Posts: 8,117
cPanelDavidG is on a distinguished road
Quote:
Originally Posted by rongup View Post
Is there a way to unzip a file using some CPanel or Perl Modules in a PHP file
That functionality isn't part of API1 or API2, so you'll need to rely on the programming language you are using to handle that for you.
__________________
Need technical assistance? You can find your best avenue for support at: http://support.cPanel.net
-- cPanel David G., Lead Forum Administrator & cPanel Technical Sales Representative
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 06:02 PM.


Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
© cPanel Inc