-   Programming (
-   -   PHP-cli standalone/portable on linux (

indileosat 11-28-2012 05:02 AM

PHP-cli standalone/portable on linux
I looking a way to get php5-cli portable on linux.
Any help? Please??

Snark1994 11-28-2012 05:10 AM

Have you had a look at

indileosat 11-28-2012 04:14 PM

Perfect! but still didn't help

Originally Posted by Snark1994 (Post 4838641)

Thanks a lot for the link Shark1994! That's one great link. Shows that what I want can be possible with only one binary file of php. I seems to be going to right direction to fulfill my purpose.

I tried using the php5 included on that link. But that binary does not have option to run php code through command line using '-r' switch.

All I need is php-cli with mcrypt module support to run a very small php code through command line. This lil php code will be used as a command in a shell script as a part.

php -r 'phpinfo();'


php -r 'mcrypt_decrypt(<codehere>);'

I think I might have to manually compile PHP from source code to make a binary like that. Can anyone help in this regards please?

Thanks again!

indileosat 11-29-2012 08:33 AM

I made it!
Well, this way or another, I made what I wanted.

Used this link for help:

Used the following switches with php configure:

./configure --enable-static --disable-cgi --without-mysql --disable-all --with-mcrypt
I didn't need PHP CGI support, all I needed was PHP on cli with mcrypt support. So, that's it. It's done. After make a portable PHP binary is available.

Though it still needs libmcrypt installed as dependency on system. But, good thing is it doesn't need to port any PHP module/extension with it. That I can live with.

I tried using Statifier to build a perfect portable PHP, but that gave segmentation fault.

Ermine trial did pretty well making the installed php to make a portable php, which does not need any dynamic linked dependencies on system. But, that's trial.

Anyway I'm happy that I got a bit of what I was looking for.

Thanks for any help provided here.


Snark1994 11-29-2012 10:44 AM

You know there's an "mcrypt" terminal command, yeah? But glad you got it sorted, anyway...

Unless you've got further questions/problems, please mark the thread as "SOLVED".


All times are GMT -5. The time now is 05:52 AM.