How to bundle a php application with 1 click run/install - php

I create php application for small businesses. Some of the clients may prefer running the app on a local server, therefore my requirement is to create/bundle an app with apache/mysql/php with all the necessary confirguration and one click executable (be it a batch file) such that when the user opens it, it runs the apache server on some port say localhost:1234 and mysql as well.
and opens up the application in the default web browser.
To be more exact, Im looking for something like http://www.simpleinvoices.org/go, check their Simple Invoices for Windows which come budled with apache/php/mysql.
P.S - Im not sure if this question should be at SO or Superuser.

If you actually want to install a web server and a SQL server then Lars' solution would be a way to go. On windows you can generate a .msi installer containing the dependencies you need (like WAMP). An installer executable would be a cleaner solution than a batch file in my opinion, as it will also provide the user with an option to uninstall your software if they wish.
If you want to distribute your application in a standalone version, then you might also want to check a solution like NuSphere's PHPDock - http://www.nusphere.com/products/phpdock.htm

I had the same challenge and came across Uniform Server:
http://www.uniformserver.com/
You download it, add your application to it, start it and everything runs. Lovely.

Superuser would have been better. But depending on your requirements, you should just create a package to install. On windows, package it with WAMP, on linux, package it with either one-click-install or creating packages for the two biggest systems, namely APT and RPM. With the dependency-system on all of them you can make sure, that your application runs right off the bat.

PHP Desktop is the best option I found when researching this.
https://github.com/cztomczak/phpdesktop
PHP Nightrain is also an option:
https://download.cnet.com/PHP-Nightrain/3000-10248_4-76169308.html
Bitnami WAMP stack looks good as well:
https://docs.bitnami.com/installer/infrastructure/wamp/

Related

How Can I make portable xampp project

Let I have developed a dictionary application in mysql using php in xampp. That is i can access it using localhost from my browser. But i do not want it to be online. I want to release an offline version of it. So that I can distribute the project using cd or pendrive and user just take it and run it. That is I want to make it portable in offline.
How can I do that. That is should I install xampp in all the cd and import my database ? Or is there any smart solution?
By it's very nature, XAMPP is portable. You can just extract it and run it. When you run it it will run Apache, mySQL and you can access it by http://localhost or by a different address according to your host file configuration if it has been changed from the default.
So put it on a laptop or onto a pen drive and you can run your code and database from it.
Here's the description of XAMPP:
XAMPP is an integrated server package of Apache, mySQL, PHP and Perl (the AMPP in XAMPP) that all run from a removable drive. Everything is pre-configured and ready to go just by unzipping or installing it.
Why not to search first? )
There is similar question: https://stackoverflow.com/a/12272455/2792335
I think you should first migrate database from MySQL to something like SQLite to avoid need of db server installation.
Then use something like http://www.nusphere.com/products/phpdock.htm or one of applications referenced in the above mentioned answer.
PHP and mysql is not a good platform for such task. PHP to operate need running sever(i.e apache) with support for right version of php. an mySQL is commercial product, you can use it for free, but if you want to include it with your product as you described you need commercial license. I would suggest to rewrite product to another platform. In example you can use JavaScript and HTML5 storage instead for data. or pick different database.

Custom PHP/Apache2 Installer with web application

I want to make custom php/apache2 installer including my web application for distribution. So for example user downloads the one click installer and he will have installed php/apache2 and web application. And all he have to do is go to localhost. (The best thing would be double click then shortcut icon just to go to localhost in browser, but check that apache is running)
What is the proper way to do it? Any tips, easy tip of doing it?
p.s. for all popular os Mac OS, Win, and Linux/Ubuntu
I'd ship a Virtual Machine with the application, and supporting platform, installed and ready to go. Virtualbox is well supported and would be a good place to start.
Good luck,
Anthony.
Latest PHP version has a webserver included and with SQLite, all you need is to start PHP WebServer, maybe it could help to make a lightweight installation.

What is needed for a user to download and run a PHP application?

I'd like to develop a PHP application that users would download and then could run. The application will have a web service.
I assume they will need Apache, but my main question is what is needed for PHP to run on their machine? Is there something needed like the JVM in Java or the .Net framework in .Net? What is it called and how difficult is it for them to download (size, etc.).
Is anything else required that I did not mention?
Thank you,
They will need a web server with a compatible version of php. That's it.
Are you asking what is required to run a .php file on a windows machine? Do you mean like an executable or a web server script?
If like an executable need the php files:
Download the php installer from http://windows.php.net/download/, and then you can run php.exe script.php
If like a web site:
You need a webserver (like apache) and the php.exe files. I would suggest if testing to download a prebuilt webserver like XAMPP (download from http://www.apachefriends.org/en/xampp-windows.html)
It depends on the application. At a minimum it will need PHP.
Is there something needed like the JVM in Java or the .Net framework in .Net? What is it called and how difficult is it for them to download (size, etc.).
PHP. Presumably as difficult as it is for you, but it depends on the platform. OS X comes with it. Most Linux variants either come with it, or allow it to be installed with one command to the package manager. Windows users will have to download it seperately.
As for other things that might be needed…
If it has a GUI, it might need PHP-GTK.
If it expects to be accessed via HTTP then they will need a webserver which supports PHP. This could be Apache, IIS, or one of numerous other servers.
(It isn't clear if, when you say "The application will have a web service.", you mean "The application will access a web service" or "The application will provide a web service". If the latter, then a web server will be needed).
If you use any non-core modules, then they will be needed as well.
You need to describe your proposed application a bit better. Is there a reason the application must be in PHP? It may be possible, but it's certainly not common to code and distribute a desktop application written in PHP.
There are a few options.
If you are just writing a script (command line, etc) you don't need a webserver. You just need PHP installed to run it (there are even downloadable installers for it).
If you are writing a web-based tool, then you will need your users to have a webserver if they are meant to run it on their physical machines. And you don't need a framework...
just think of it as a Webserver + PHP as a plugin. Some webserver options: Apache, nginx, lighttpd
Try having users install WAMP, MAMP, or Zend Server CE all of which are free and come with both a webserver and PHP.
If you really want a deployable PHP script/tool, maybe look into something like PHPDock, which gives your users a single installable app (embedded server, php). NuSphere PHPDock
Honestly, it's not the greatest language to use for this type of deployment, but it's certainly fun to try to figure out! Sorry for not linking out also, don't have enough rep points for all of the links I had intended to supply.
Actually you can run php script without the need to have a webserver installed.
Just install php and then from command line:
$ php myscript.php
If you really want you can even build GUI application with php even though I would not suggest it.
Cheers Andrea
you could also try to use quercus.
Quercus is Caucho Technology's fast,
open-source, 100% Java implementation
of the PHP language (requires JDK
1.5).
This way you only will need a jvm+quercus. It also is platform independent this way because it runs in the JVM.

start php, apache?

I've just started reading about php, it needs me to install php, apache and MySql to run any php script. can any one suggest me a simplest method to install php, apache and MySql so that i can sun those php script.
I've tried the zip files from php.net, Are those required to run the script offline for practicing the script? what do i do with them? i felt the things given on the same site a bit complex, and was unable to run the script. please help.
I'm assuming you're using Windows - get wamp - it has exactly what you need:
Apache
MySQL
PHP
Wamp comes with a nifty tray controller app which you can use to access the most common tasks, like restarting services, editing config, etc.
Equivalent to Artem's post, just a different organization which packages it differently. And my preference. It is called XAMPP.
If you are using Windows, you could install XAMPP to have the environment setup for you. You'll then need to learn how to bring up the server (basically executing the XAMPP control panel program), copy your PHP scripts into the correct directories (for XAMPP, it'd be C:/[xampp installation dir]/htdocs), access MySQL and creating the necessary MySQL databases (you could access the MySQL via the included PhpMyAdmin).
You can probably refer to a tutorial here (it's a YouTube video, BTW).
Don't have enough rep to comment but wanted to add something to Artem's recommendation of Wampserver. It's what I use on my windows machine, and one of the nicest things about it I find is the ability to have multiple versions of versions of apache, php and mysql installed alongside each other as plug-ins and then select which to have running at any time. It makes it easy for me to emulate the eventual hosting environment for any given project.

Create an Installer package for Installation on WAMP

I have developed a PHP web application, now I am thinking about deploying it on Windows.
To ease my deployment, I plan to create an installer for it. This installer should do the following:
Check for Pre-requisites such as Apache, MySQL etc, install them if they are not available
Put the PHP application on Application folder, and in this process set the port number, create a conf file for the application, update the httpd.conf to make sure that it refers to the application-specific conf file.
Run database setup script and database population script that I prepared.
Set the database setting in the application config files so that they are pointing at the correct database.
I am looking for a installer to help me on this regard, something like Advanced Installer. Of course, I still have to write a lot of custom actions code for it, which is something I really hate.My question now is that is there anyone who has done all these stuffs and are willing to share his code, so that I don't have to do everything from scratch?
I think you are looking for this http://installbuilder.bitrock.com/. Bitrock is used by a few big projects like SugarCRM, etc to get their LAMP stack on other computers. Give it a try!
You could try movAmp. This will pack your application to one working executable, including apache/php/mysql.
Your application therefore should be aware if it is installed or not, say redirect to an install-script on first hit.
Movamp is an environment of
development to be taken.
MovAMP was conceived to hold on a key
USB or any other support of weak
capacity. Connect it up in a computer
equipped with Microsoft Windows and
you have access to a server web,a
database and INTERPRETER PHP. If
MovAMP succeeds in contenting himself
of not much of space, he can offer
also installed on a workstation.
Comparable in EasyPhp or WAMP5, MovAMP
inserts APACHE 2.0.54, MYSQL 4.1.12,
PHP 5.0.4 and phpMyAdmin 2.6.2-pl1.
Exits of the development of free
software, these technologies proved
their fastness and their stability.
Once thrown, he adds an icon to the
zone of notification allowing to stop
the server Apache and MySQL or to
achieve the reception of the site or
in phpMyAdmin.
Link

Categories