How to enable php cli?
I have a dedicated server running Fedora Core 6 (64-Bit)
with php 5.1.6. warboot.com/phpinfo.php php directory /usr/bin/php Let me begin by saying I'm new to linux and do not have that much experience when it comes to linux. I need to enable cli for php, i need it for a video script. I have looked through various websites and could not find a way to do this, without reinstalling php (that i don't know how to do). Any help would be greatly appreciated! |
Cli
Since PHP 4.3.0 the CLI SAPI is on by default. If you use the Fedora 6 installed PHP 5.x version than you should have it already. Unless you compiled PHP yourself and disabled CLI, but then you would know about it.
CLI means Command Line Interface. To run a PHP script from the terminal type: Code:
$ php my_script.php param1 param2 paramN Hope this helps, Regards, SIMP |
thanks
Thank you for reply. I have a 1and1 dedicated server, so they had all the stuff installed already, i rang them up, and they cant provide me any support with this.
Basically my script is here http://warboot.com/tube/install/index.php?lng=en (ostube script) it says: "The command line version of PHP could not be found. Please make sure that the cli version is installed, and that mysql.so is also activated for the cli." So i need to fix this. Any ideas? |
some options
The server has a PHP version with CLI disabled. Not uncommon that system administrators recompile certain packages to their liking.
I think it's paranoid to remove CLI, but some people might argue that PHP is mainly used for generating webpages and the majority will not use CLI anyway. They think it's a security problem, which is a silly. If some intruders have taken over the server already, then a missing CLI from PHP will not hold them back. If this is not your own server and you can not convince them to reinstall PHP with CLI or at least install an additional PHP version with CLI (also possible), then you still have a few options: 1) switch service provider (phpwebhosting.com seems to be a good choice) 2) modify the script: where arguments like $argc and $argv[1] appear, you must change them to $_REQUEST['your-argument-name-here'], and additionally create an HTML page with a webform that passes 'your-argument-name-here' to your script. If your not skilled with PHP or osTube is too complex for you (never mind, it's too complex for most of us), then you can still put up a bid request on rentacoder.com or similar. Hope this helps, Regards, SIMP Fedora User |
well..
Well i have root access, so i have full control, and they will not reinstall php for me. I cannot switch service provider as i have a 2 year contract which began this month, so i have to make this work.
You said i could install an additional php module with cli enabled? How would i do this? As for modifying the script, I'm not that advanced =P thx for your help |
multiple PHP's
Quote:
I've never done that, but should I face something like this, then I would consider these options: - install PHP as a non-root user into the user's home directory. This way even the configuration files are stored within the home directory. Must set permissions so that Apache can access the files. - install as root in a different location - the root account would still allow to overwrite existing config files in /etc. Both installs would use the same config files - could work, but can be tricky. In both cases: You have to make changes so that the video script will be launched by the proper PHP version. How to do this depends on the internals of the code. In the most simple case a shebang-line is enough like: #!/home/user/bin/php I'm a bit surprised that Fedora 6 has a CLI-disabled PHP set. I'm using a plain Fedora 8 install and have CLI by default. Since you have root access and somehow own the box, you could reinstall PHP yourself using 'yum' or 'rpm'. You could even upgrade to Fedora 8, as Fedora 6 isn't supported anymore with security fixes as far as I know. This won't be easy. You should do some install tests on a local box to avoid breaking your server. Regards, SIMP |
cli
That is 2 much hassle for a linux noob like me, ill probably end up breaking the server. Is it not possible to somehow upgrade the php installation to the the latest version, but it keeps all the original settings in tact, but i just add the line --enable cli or something?
As for installing the php in another location, and trying to edit the script, could work, but then i would have to ask whoever made the script how to do it exactly. thanks |
php -v
Right now we just assume that the osTube installer provides correct output. Run:
Code:
php -v Code:
$ php -v Enabling CLI is a compile-time option, you can not add it later as a module. Under normal circumstances you will have 'yum' installed. If you decide to re-install PHP, then: Code:
yum remove php # removes the current PHP, needs confirmation Good luck and let me know how it goes. Regards, SIMP |
php4-cli
Hi,
Just as an addition or correction: For PHP there was/is a module available called php4-cgi, which should have an addition called php4-cli. I guess there must be a version for PHP5 as well ... I don't know for sure. I can't tell if this php4-cgi or php5-cgi is a valid replacement for a full PHP build with CLI enabled, but it is worth to check. Bye, Marq Linux Archive |
Quote:
|
All times are GMT -5. The time now is 02:51 PM. |