larger smaller normal text version of this page

Revision [987]

Last edited on 2006-12-04 19:28:09 by AlStillero [minor edit]
Additions:
If you have commandline access you can use the following method to determine which PHP interface version your server is running. From the command line prompt type the following command: **php -v**
Deletions:
If you have commandline access you can use the following method to determine which PHP interface version your server is running. From the command line prompt type the following command: **PHP -v**


Revision [959]

Edited on 2006-11-22 05:08:19 by AlStillero [Minor addition]
Additions:
The best known interface of PHP is the HTTP interface implemented in the PHP-Apache-Module, which is not standalone and which is used for the classical HTTP request (like ""http://www.mydomain.com/phpinfo.php""). This interface is used when making calls to PHPlist with a standard browser. A typical example of calling a script with the HTTP interface is:
You can also use the [[http://en.wikipedia.org/wiki/Lynx_(web_browser) Lynx]] text browser, [[http://en.wikipedia.org/wiki/Wget Wget]], [[http://en.wikipedia.org/wiki/HTTP Get]] or [[http://en.wikipedia.org/wiki/CURL cURL]], if available on your server. Here are some examples how you could use these from the commandline:
curl -s 'http://www.domain.com/lists/admin/index.php?page=processqueue&login=USERNAME&password=PASSWORD' >/dev/null
Deletions:
The best known interface of PHP is the HTTP interface implemented in the PHP-Apache-Module, which is not standalone and which is used for the classical HTTP request (like ""http://www.mydomain.com/phpinfo.php""). This is interface used when making calls to PHPlist with a standard browser. A typical example of calling a script with the HTTP interface is:
You can also use the [[http://en.wikipedia.org/wiki/Lynx_(web_browser) Lynx]] text browser, [[http://en.wikipedia.org/wiki/Wget Wget]] or [[http://en.wikipedia.org/wiki/HTTP Get]], if available on your server. Here are some examples how you could use these from the commandline:


Revision [946]

Edited on 2006-11-07 05:49:50 by AlStillero [Some additions]
Additions:
===How to determine the PHP interface version of your server===
If you have commandline access you can use the following method to determine which PHP interface version your server is running. From the command line prompt type the following command: **PHP -v**
If your server is running PHP-cli, you should see something similar to this:
%%PHP 4.3.3 (cli) (built: Jun 8 2004 19:27:04)
Copyright (c) 1997-2003 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2003 Zend Technologies%%
If your server is running PHP-cgi, something like this would be displayed:
%%PHP 4.3.3 (cgi) (built: Nov 10 2003 13:05:54)
Copyright (c) 1997-2003 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2003 Zend Technologies%%


Revision [928]

Edited on 2006-10-31 02:28:20 by AlStillero [minor edits]
Additions:
//This page briefly describes the different interface versions of PHP. This may be important when setting up a cron job or commandline script. Both the title and the basic content of this article are based on a forum post from jotazzu, with some additions and edits from my part//
Most -if not all- timeouts are active in the CGI version. For queue processing this is 600 seconds, though in reality this may reach up to 1200 seconds (20 minutes). This implies you may have to reload the command in order to process all messages (see also [[CronJobExamples cron job examples]]).
Things are quite different when using the CLI version of PHP: You do not need to specify login information. Instead the value of the environment variable USER is compared against the entries in the array ''$commandline_users'' in config.php. Only if a match is found, will the script be executed.
The parameters used with PHP-cli differ from the CGI version. The page to execute is set with the parameter -p and to load the relevant values contained in the config.php file you use the -c parameter. Incidentally, the allowed parameters do not depend on PHP-cli, but on what is programmed in PHPlist.
Of course, these commands can easily be placed in a crontab file and scheduled to be executed on a predefined time. For more information, please read [[SetupCronJob setting up cron jobs]] and [[CommandLineScriptInfo using a command line script]]. You may find it useful to look at some of the working examples forum users have provided: [[CronJobExamples cron job examples]].
- [[CronJobExamples Cron job examples]]
Deletions:
//This page briefly describes the different interface versions of PHP. This may be important when setting up a cron job or commandline script. Both the title and the basic content of this article are based on a forum post from jotazzu, with some minor additions and edits from my part//
Most -if not all- timeouts are active in the CGI version. For queue processing this is 600 seconds, though in reality this may reach up to 1200 seconds (20 minutes).
Things are quite different when using the CLI version of PHP:
You do not need to specify login information. Instead the value of the environment variable USER is compared against the entries in the array ''$commandline_users'' in config.php. Only if a match is found, will the script be executed.
The parameters used with PHP-cli differ from the CGI version. The page to execute is set with the parameter -p and to load the relevant values contained in the config.php file you use the -c parameter. The allowed parameters do not depend on PHP-cli, but on what is programmed in PHPlist.
Of course, these commands can easily be placed in a crontab file and scheduled to be executed on a predefined time. For more information, please read [[SetupCronJob Setting up cron jobs]] and [[CommandLineScriptInfo Using a command line script]]. You may find it useful to look at some of the working examples forum users have provided: [[CronJobExamples Cron Job Examples]].


Revision [918]

Edited on 2006-10-25 06:44:14 by AlStillero [some edits, minor additions]
Additions:
The CGI interface behaves much in the same way as when calling PHPlist with a browser, even though it's not using the HTTPD protocol:
The config.php file cannot be loaded into environment, which is similar to the the HTTP interface. This means you need to specify the login name and password for access to the PHPlist admin module as you would with a browser.
Also, the parameters are identical to the call with a browser, despite the fact that the PHP script is called as a local file and not as a web address, and even though the '?' and '&' are removed.
Most -if not all- timeouts are active in the CGI version. For queue processing this is 600 seconds, though in reality this may reach up to 1200 seconds (20 minutes).
Things are quite different when using the CLI version of PHP:
You do not need to specify login information. Instead the value of the environment variable USER is compared against the entries in the array ''$commandline_users'' in config.php. Only if a match is found, will the script be executed.
The parameters used with PHP-cli differ from the CGI version. The page to execute is set with the parameter -p and to load the relevant values contained in the config.php file you use the -c parameter. The allowed parameters do not depend on PHP-cli, but on what is programmed in PHPlist.
Of course, these commands can easily be placed in a crontab file and scheduled to be executed on a predefined time. For more information, please read [[SetupCronJob Setting up cron jobs]] and [[CommandLineScriptInfo Using a command line script]]. You may find it useful to look at some of the working examples forum users have provided: [[CronJobExamples Cron Job Examples]].
For more information on PHP-cli and PHP-cgi, please read [[http://nl2.php.net/manual/en/features.commandline.php Using PHP from the command line]], and [[http://nl2.php.net/manual/en/install.unix.commandline.php CGI and commandline setups]].
Deletions:
The CGI interface behaves much in the same way as when calling PHPlist with a browser, even though it's not using the HTTPD protocol. This means you need to specify the login name and password for access to the PHPlist admin module as you would with a browser. Also, the parameters are identical to the call with a browser, despite the fact that the PHP script is called as a local file and not as a web address. All '?' and '&' are removed. The config.php file cannot be loaded explicitly, which is similar to the the HTTP interface. And finally, most -if not all- timeouts are active in the CGI version.
Using the CLI version you do not need to specify login information. Instead the value of the environment variable USER is compared against the entries in the array $commandline_users in config.php. Only if a match is found, will the script be executed. The parameters are also not like the CGI version. The page to execute is set with the parameter -p and the reference to the config.php file to use is set with the parameter -c. The allowed parameters do not depend on the CLI, but on what is programmed in PHPlist.
For more information please read [[http://nl2.php.net/manual/en/features.commandline.php Using PHP from the command line]], and [[http://nl2.php.net/manual/en/install.unix.commandline.php CGI and commandline setups]].


Revision [911]

Edited on 2006-10-25 01:23:09 by AlStillero [some additions]
Additions:
Note the similarities with the HTTP calling method in this typical example of calling a script with the PHP-cgi interface from the command line:
%%(html4strict)
/bin/usr/php /home/domain.com/lists/admin/index.php page=processqueue login=myusername password=mypassword >/dev/null
You can also use the [[http://en.wikipedia.org/wiki/Lynx_(web_browser) Lynx]] text browser, [[http://en.wikipedia.org/wiki/Wget Wget]] or [[http://en.wikipedia.org/wiki/HTTP Get]], if available on your server. Here are some examples how you could use these from the commandline:
%%(html4strict)
lynx -dump 'http://www.domain.com/lists/admin/index.php?page=processqueue&login=myusername&password=mypassword' >/dev/null
%%(html4strict)
wget -q -O - 'http://www.domain.com/lists/admin/index.php?page=processqueue&login=myusername&password=mypassword' >/dev/null
%%(html4strict)
GET 'http://www.domain.com/lists/admin/index.php?page=processqueue&login=myusername&password=mypassword' >/dev/null
%%(html4strict)
%%(html4strict)
Deletions:
Note the similarities withe the HTTP calling method in this typical example of calling a script with the PHP-cgi interface from the command line:
/bin/usr/php /home/mydomain/lists/admin/index.php page=processqueue login=myusername password=mypassword


Revision [905]

Edited on 2006-10-24 01:40:27 by AlStillero [minor edit]
Additions:
Note the similarities withe the HTTP calling method in this typical example of calling a script with the PHP-cgi interface from the command line:
/bin/usr/php /home/mydomain/lists/admin/index.php page=processqueue login=myusername password=mypassword
USER=listprocessor; export USER; /usr/bin/php /home/mydomain/lists/admin/index.php -pprocessqueue -c/home/mydomain/lists/config/config.php
Deletions:
Note the similarities withe the HTTP calling method in this typical example of calling a script with the PHP-cgi interface is:
%%(actionscript)lynx -dump 'http://www.domain.com/lists/admin/index.php?page=processqueue&login=ADMIN_NAME&password=PASSWORD'
%%(php)USER=listprocessor; export USER; /usr/bin/php /home/mydomain/lists/admin/index.php -pprocessqueue -c/home/mydomain/lists/config/config.php


Revision [904]

Edited on 2006-10-23 22:11:29 by AlStillero [Some edits, additions and examples]
Additions:
//This page briefly describes the different interface versions of PHP. This may be important when setting up a cron job or commandline script. Both the title and the basic content of this article are based on a forum post from jotazzu, with some minor additions and edits from my part//
Each version of PHP (since 4.3.0) exists in 3 different interface versions: the HTTP interface, and the CLI and CGI interface. All have the same version number but the methods of calling a PHP script are different.
==The HTTP interface==
The best known interface of PHP is the HTTP interface implemented in the PHP-Apache-Module, which is not standalone and which is used for the classical HTTP request (like ""http://www.mydomain.com/phpinfo.php""). This is interface used when making calls to PHPlist with a standard browser. A typical example of calling a script with the HTTP interface is:
%%
http://www.domain.com/lists/admin/index.php?page=processqueue&login=ADMIN_NAME&password=PASSWORD
%%
==The PHP-cgi interface==
The CGI interface behaves much in the same way as when calling PHPlist with a browser, even though it's not using the HTTPD protocol. This means you need to specify the login name and password for access to the PHPlist admin module as you would with a browser. Also, the parameters are identical to the call with a browser, despite the fact that the PHP script is called as a local file and not as a web address. All '?' and '&' are removed. The config.php file cannot be loaded explicitly, which is similar to the the HTTP interface. And finally, most -if not all- timeouts are active in the CGI version.
Note the similarities withe the HTTP calling method in this typical example of calling a script with the PHP-cgi interface is:
%%(actionscript)lynx -dump 'http://www.domain.com/lists/admin/index.php?page=processqueue&login=ADMIN_NAME&password=PASSWORD'
%%
==the PHP-cli interface==
A typical example of calling a script with the PHP-cli interface is:
%%(php)USER=listprocessor; export USER; /usr/bin/php /home/mydomain/lists/admin/index.php -pprocessqueue -c/home/mydomain/lists/config/config.php
or, when using a commandline script:
/sbin/phplist -pprocessqueue
%%
Deletions:
//This page briefly describes the different interface versions of PHP. This may be important when setting up a cron job or commandline script. //
Each version of PHP (since 4.3.0) exists in 3 different interface versions. All have the same version number but the methods of calling are different.
The best known interface of PHP is the HTTP interface implemented in the PHP-Apache-Module, which is not standalone and which is used for the classical HTTP request (like ""http://www.mydomain.com/phpinfo.php""). This is interface used when making calls to PHPlist with a standard browser.
The CGI interface behaves much in the same way as calling PHPlist with a browser, even though it's not using the HTTPD protocol. This means you need to specify the login info for the PHPlist admin module as usual and probably all timeouts are active in the CGI version. Also, the parameters are identical to the call with a browser, despite the fact that the script is called as a local file and not as a web address. All ? and & are removed. The config.php file cannot be referenced explicitly because this is also not possible when calling with ""http://"".


Revision [881]

Edited on 2006-10-21 01:06:30 by AlStillero [minor edits, added links]
Additions:
Each version of PHP (since 4.3.0) exists in 3 different interface versions. All have the same version number but the methods of calling are different.
For more information please read [[http://nl2.php.net/manual/en/features.commandline.php Using PHP from the command line]], and [[http://nl2.php.net/manual/en/install.unix.commandline.php CGI and commandline setups]].
- [[CommandLineScriptInfo Using a command line script]]
Deletions:
Each version of PHP (since 4.3 ?) exists in 3 different interface versions. That means all have the same version number but the methods of calling it differ.


Revision [880]

Edited on 2006-10-21 00:14:30 by AlStillero [Preparation of the page and added edited version of jotazzu's article]
Additions:
==[[PhplistDocumentation Phplist Documentation]] » [[MessageFunctionsInfo Message functions]] » [[ProcessQueueInfo Process the message queue]] » [[SetupCronJob Setting up cron jobs]] » ==
=====The three interfaces of PHP =====
//This page briefly describes the different interface versions of PHP. This may be important when setting up a cron job or commandline script. //


Each version of PHP (since 4.3 ?) exists in 3 different interface versions. That means all have the same version number but the methods of calling it differ.

The best known interface of PHP is the HTTP interface implemented in the PHP-Apache-Module, which is not standalone and which is used for the classical HTTP request (like ""http://www.mydomain.com/phpinfo.php""). This is interface used when making calls to PHPlist with a standard browser.

Both the CGI (Common Gateway Interface) version and the CLI (Command Line Interface) version of PHP are standalone programs. You do not need another program, like the Apache web server, to execute PHP pages. However, both interfaces have marked differences in the way they should be treated.

The CGI interface behaves much in the same way as calling PHPlist with a browser, even though it's not using the HTTPD protocol. This means you need to specify the login info for the PHPlist admin module as usual and probably all timeouts are active in the CGI version. Also, the parameters are identical to the call with a browser, despite the fact that the script is called as a local file and not as a web address. All ? and & are removed. The config.php file cannot be referenced explicitly because this is also not possible when calling with ""http://"".

Using the CLI version you do not need to specify login information. Instead the value of the environment variable USER is compared against the entries in the array $commandline_users in config.php. Only if a match is found, will the script be executed. The parameters are also not like the CGI version. The page to execute is set with the parameter -p and the reference to the config.php file to use is set with the parameter -c. The allowed parameters do not depend on the CLI, but on what is programmed in PHPlist.


==Related pages==
- [[SetupCronJob Setting up cron jobs]]
Deletions:
[[PhplistDocumentation Phplist Documentation]]
=====Title of the page =====
//This page is a **template** intended for documentation of **official phplist features**. This page belongs to CategoryTemplate (which contains more handy templates). To create a phplist **documentation** page, [[http://docs.phplist.com/DocumentationTemplate/clone clone this page]], replace the title with a meaningful one and replace this paragraph with the actual page content.//


Revision [879]

The oldest known version of this page was created on 2006-10-20 23:54:27 by AlStillero [The three Interfaces of PHP]
Page was generated in 0.0355 seconds