LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 11-28-2012, 05:02 AM   #1
indileosat
LQ Newbie
 
Registered: Nov 2012
Posts: 10

Rep: Reputation: Disabled
Question PHP-cli standalone/portable on linux


I looking a way to get php5-cli portable on linux.
Any help? Please??
 
Old 11-28-2012, 05:10 AM   #2
Snark1994
Senior Member
 
Registered: Sep 2010
Location: Wales, UK
Distribution: Arch
Posts: 1,632
Blog Entries: 3

Rep: Reputation: 345Reputation: 345Reputation: 345Reputation: 345
Have you had a look at http://www.magentocommerce.com/knowl...-a-php4-server?
 
Old 11-28-2012, 04:14 PM   #3
indileosat
LQ Newbie
 
Registered: Nov 2012
Posts: 10

Original Poster
Rep: Reputation: Disabled
Smile Perfect! but still didn't help

Quote:
Originally Posted by Snark1994 View Post
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.

Example:
php -r 'phpinfo();'

or

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!
 
Old 11-29-2012, 08:33 AM   #4
indileosat
LQ Newbie
 
Registered: Nov 2012
Posts: 10

Original Poster
Rep: Reputation: Disabled
Talking I made it!

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

Used this link for help:
http://www.tipcache.com/tip/Build_PH...binary_15.html

Used the following switches with php configure:
Code:
./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.

Cheers!
 
Old 11-29-2012, 10:44 AM   #5
Snark1994
Senior Member
 
Registered: Sep 2010
Location: Wales, UK
Distribution: Arch
Posts: 1,632
Blog Entries: 3

Rep: Reputation: 345Reputation: 345Reputation: 345Reputation: 345
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".

Thanks,
 
  


Reply

Tags
php, php5, phpini


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Standalone portable ftp server MikeyCarter Linux - Software 1 02-10-2012 11:07 PM
Linux Bash-PHP CLI error (path?) superportal Linux - Server 1 06-11-2009 01:55 AM
List of standalone, portable linux applications mahdif Linux - Software 9 03-17-2009 04:11 AM
need a portable linux distro to bring on portable usb hard drive... pippo17 Linux - Distributions 3 10-20-2008 06:41 AM


All times are GMT -5. The time now is 02:59 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration