How Can I make portable xampp project - php

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.

Related

Configuring php desktop chrome for allowing it to connect to sql server

I wanted to convert my php application into desktop application to run it as an .exe file by just double clicking on it. For this I found many third party softwares like bamcompile,wapache,Php desktop chrome,etc. From these the most compatible and the one which fulfilled my requirements to accountable extent was php desktop chrome.The rest both had their drawbacks-
1.Bamcompile-It runs the application on commandline and does not show GUI,so I was not comfortable with that.
2.Wapache-It runs the application but it run it in Internet explorer browser so it cannot run the framework supported by my application.I need Google Chrome for that.
3.Php desktop chrome- This fulfills my requirement to a great extent but the problem is that it does not supports sql server database.I thought about using sql server as database because I don't want to install xampp/wamp on every machine where I want to use my application.I added the drivers needed for using sql server to php desktop/ext folder but I am not finding the php.ini in php desktop application where I can add extension to it.So it there any way that I would not have to install xampp/wamp or any other application on client machine to run my application.
Problem with converting the application into exe file is solved with php desktop. That means when I start only mysql from xampp my application runs perfectly fine ,there is no need to start apache for that.So now I want to do something that can include my database as well in the php desktop chrome folder and supporting application into it as well.So that I don't need to start phpmyadmin always.Or is it possible to install only phpmyadmin/MySQL without xampp and if yes how to configure that?Because I installed that individually but I don't know why is it showing Access denied.
Thanks in advance.
I have tried to provide as much details as possible ,in case you need to know anything else,please let me know. I have tried all possible way please help me out.
Your need is quite exotic. Try phpinfo() in your application - then you will find where your php.ini is served from. That might put you on track. Another thing to try, if your database is not too big, SqlLite database in your project, because it is bundled with php and does not require a separate server.

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

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/

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

How to upload PHP and MySQL into a webserver

I am developing a site in vertigoserver. Now I need to test the webpage in webserver.
I am using the webserver Host-Europe VirtualServer 3.0.
Now what are the steps I need to upload the PHP pages?
What is the software needed to upload MySQL queries?
Are there any tutorials or suggestions?
This seems like basic stuff, but I'll give you some pointers!
Upload the pages with an FTP client or similar. If you have shell access, tools like rsync can make this easier.
You've probably got some sort of web based front end for MySQL like phpMyAdmin - this will let you upload and restore a database dump. If you have shell access, or if the MySQL server is open to the Internet, you can pipe the dump into the MySQL command line client, for example,
mysql -h<hostname> -u<username> -p<password> mydatabase < dump.mysql
Okay, you got a virtual machine and don't know how to upload stuff? This has been discussed in Host-Europe forums for a while. If you don't know the basics you probably don't want to run a server on your own. If you don't know how to use Linux don't start with a machine which can get you in a lot of trouble. A hosting package is probably better you at the moment.
The problem I have is you didn't specify what OS you have. If you're using Linux with Plesk you want to activate FTP, etc. If you are using Linux without Plesk you want to upload the PHP files with WinSCP and over SSH (SCP).
If you are running Windows with Plesk use FTP. If not, you should install an FTP server on the machine.
Regarding the MySQL stuff you're probably best off installing a webfrontend for MySQL.
!DON'T FORGET TO SECURE IT!

Categories