lsphp from command line and cron

#1
Hi All,

Just testing out OpenLitespeed, so far very impressed, really easy to configure and get running.
I am having a couple of small issues, probably a lack of understanding how the system hands together.

I was able to get my php website (magento) to run perfectly, then i went to the command line to run an index php file manually and noticed that i can't run lsphp from command line.

I tried installed CLI (command line interface) and that didn't help.

This means I can't run any php scripts via cron.

Any tips or guidance?

thanks

p.s using Centos 7 on AWS
 

lsmichael

Active Member
#2
Hi @Rudi,

Sorry for the delayed response. A lot of OpenLiteSpeed materials can be found in our Enterprise wiki. Unless something in the Enterprise refers to using Apache configuration files (like when you're configuring something with a control panel), it's generally applicable to OpenLiteSpeed. (One day we'd like to have two completely separate wikis...)

I believe this should describe what you're trying to do, unless I've misunderstood: http://www.litespeedtech.com/support/wiki/doku.php?id=litespeed_wiki:php_lsapi_command

Cheers,

Michael
 
#3
Hi Michael, thanks for your help, thats what i need to do, but i can't get it to work.

I think my path to php is:

/usr/local/lsws/lsphp56

so i try

Code:
/usr/local/lsws/lsphp56 -b [::]:3000
and get this error

-bash: /usr/local/lsws/lsphp56: Is a directory
dos anyone know the actual path to lsphp ?
 
#5
Hi Fearless, thank you, I am getting closer!
it doesn't seem that the -b (Bind option) works ? this was the output if anyone can help.
Usage: php [options] [-f] <file> [--] [args...]
php [options] -r <code> [--] [args...]
php [options] [-B <begin_code>] -R <code> [-E <end_code>] [--] [args...]
php [options] [-B <begin_code>] -F <file> [-E <end_code>] [--] [args...]
php [options] -S <addr>:<port> [-t docroot]
php [options] -- [args...]
php [options] -a
-a Run as interactive shell
-c <path>|<file> Look for php.ini file in this directory
-n No php.ini file will be used
-d foo[=bar] Define INI entry foo with value 'bar'
-e Generate extended information for debugger/profiler
-f <file> Parse and execute <file>.
-h This help
-i PHP information
-l Syntax check only (lint)
-m Show compiled in modules
-r <code> Run PHP <code> without using script tags <?..?>
-B <begin_code> Run PHP <begin_code> before processing input lines
-R <code> Run PHP <code> for every input line
-F <file> Parse and execute <file> for every input line
-E <end_code> Run PHP <end_code> after processing all input lines
-H Hide any passed arguments from external tools.
-S <addr>:<port> Run with built-in web server.
-t <docroot> Specify document root <docroot> for built-in web server.
-s Output HTML syntax highlighted source.
-v Version number
-w Output source with stripped comments and whitespace.
-z <file> Load Zend extension <file>.
args... Arguments passed to script. Use -- args when first argument
starts with - or script is read from stdin
--ini Show configuration file names
--rf <name> Show information about function <name>.
--rc <name> Show information about class <name>.
--re <name> Show information about extension <name>.
--rz <name> Show information about Zend extension <name>.
--ri <name> Show configuration for extension <name>.
 
#6
Hmm, what did you need -b for? If you just wanted to run php scripts via cron I don't think that is necessary. I'm using that path to run a cron and it seems to work.
 
#8
Ah I'm not sure then I guess you'll have to wait for the support team.

For shortening the path couldn't you just add to the path variable, or even easier is editing the ~/.bashrc file (if on CentOS) for your user and add an alias such as:
alias php='/usr/local/lsws/lsphp5/bin/php'

Then you could use php -v for example.
 

lsmichael

Active Member
#10
Howdy @Rudi,

I just wanted to let you know that the developers have looked at this. They think the issue may have been caused by using an IPv6 address with -b. Have you tried this with an IPv4 address. (I know you fixed it, but, well, I'd like to know.)

Cheers,

Michael
 

lsmichael

Active Member
#12
Hi Rudi,

Thanks for reporting. I've added it to our bug list. I'm not sure that this is the most high priority issue, but we will get to it.

Cheers,

Michael
 
Top