简体   繁体   中英

Lite version of PHP?

I was just wondering if anyone knows if there is a smaller version of php. I don't need any full-blown apache support I just need to be able to execute "php" to run a script in the terminal.

I already have PHP installed on the server, but I do not have access to running "php" in the terminal. I'd just like to run my script that I wrote in PHP.

Thanks, Matt Mueller

Maybe this won't work for you, but on every Linux system with PHP installed that I've used, I've been able to do the following to run a php script from the command line:

$ php SCRIPTNAME

Alternatively, to see if you can run a php script, you could also try:

$ which php

If you have command line access to php, this should tell you the path to the executable.

Many Linux distros have a package that contains the CLI version of PHP. On modern Fedora and derivatives (RHEL, CentOS, etc.) that package is php-cli . If that package is installed (use rpm -q php-cli to find out) and you still cannot use the php executable then you should consider asking the system administrators why they've disabled it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM