"Minified" version of xampp? - php

I'm looking for a way to share my php applications with a colleague without using a server. My colleague isn't really versed in xampp and localhost stuff, so ideally, he shouldn't have to install or configure anything.
I'm already using SQLite to make my application more portable, but I need to figure out how to handle the php side of things. Is there a way to create a "mini" xampp or localhost that the php files can run on? Ideally, my colleague should just need to start up one program, at which point the localhost address would point to my files. Is something like that possible with xampp?

You can use ngrok. ngrok build a url for your localhost project. which you can share to your colleague or anywhere across the globe.

You can start a web server using the php executable:
php -S localhost:8000
http://php.net/manual/en/features.commandline.webserver.php

You can use Devserver. It's portable. You just have to put the Devserver folder (with your files in Local Directory) on a USB key.

It should be said that there are very, very few times where what you're talking about should be necessary. If this is a truly "personal use" case, you could just put the scripts online and set up an htaccess password for your friend. If it's software you're trying to distribute, you could create cloud access for it.
Having said that, I do have a piece of software in the wild that matches this description. The reason it needs to run its own server and be accessible locally is because it (a) runs in retail stores, (b) serves and receives data with a corporate android app only on the local network in those stores and (c) must continue to run with local data if the internet connection goes down at any given store.
The only way to do this at the moment is ship a physical mini PC stick, preloaded with XAMPP, the database, and the whole set of PHP scripts and a nice index.php file at the local root, to each and every store. In my case, this required building an internal update mechanism to push software updates as necessary. But you could probably just have your friend download a zip file with updates and replace his www root folder with it.
If you can afford $100 for a cheap PC on a stick, this is probably your best answer. It's definitely the fastest. You could wade into trying to compile your PHP code, but there is no complete solution for that.

It is actual question for me to, so I made a little research and from what I have read the most perspective way is to use a vagrant. You still will need to do a lot of configurations, but mainly on your side. Your college can deploy fairly easy and pain fry.
I found this article describing a basic workflow very useful.
Update #2: If for some reason vagrant or any other type of virtualization is not an option for you consider looking to portable xampp launcher instead

Related

PHP project with MySQL data on CD/DVD

Exist any way, how to place the PHP project with MySQL database on CD/DVD with full functionality? My client would like have his presentation on the CD and this CD he'd give his customers.
And the idea is, that these customers just put the CD into their PC and run the complet web presentation on their computer...
Is that sci-fi or exist any way to do that?
Thank you
The CD/DVD will have to have Apache/MySQL/PHP available to it - what you're looking for is a "portable webserver" to be run from the DVD. I used something called The Uniform Server some time back with pretty good success.
Well, the only solution I can see is not use a server-side language (seeing as there is no server here), but use only HTML+CSS+JavaScript to make your presentation, hard code the content with the HTML, and don't use a database.
Burn all of that on a CD (have an index.html page on the root folder) and when that is run from a browser, it should work.
Since most folks have internet access these days, I'd make an index.html file with a meta-refresh to a regular web page online. You can even make an autorun.inf that launches that file, but note that most computers have autorun functionality disabled these days.
You can checkout Server2Go. I only found it via googling so I can't speak as to how well it works, but it seems like it has everything you're looking for.
You can create an entire live Linux environment that they can boot off of a CD. Take a look at Knoppix. Their wiki has instructions for mounting the OS, customizing it, and recreating the disk image.
Another option might be to use VMWare ThinApp to virtualize your entire application bundle (MySQL Server, application server, etc.).
On your client computer set up the server, php plugin, and mysql. The server should point to the cdrom as the root directory. Then copy all the web files onto the dvd. Do not forget to create databases on the client computer.
I just tried CDsite from the SourceForge website. It came in handy for a similar requirement of mine. However, note, works only on Windows XP. The EXE file failed to run in Windows 7.

problems exporting Solar php5 root directory from localhost to live server or even other computer

Ok,
This seems like something that would be obvious, but I haven't been able to figure this out.
I just started using Solar PHP5 Framework http://solarphp.com. It is a great php5 framework. But with any new framework the is a learning curve.
Issue: Solar uses many pre-written scripts to make directories and files for you. Making it easy to rapidly deploy a site. Being that it uses these scripts, it makes symbolic links to files and directories. (Example: Chapter 1 in the manual) This is great until you need to export your entire root directory to upload to your server or make another instance on another development computer. The problem for me is, when I do this, the files are editable, but do not reflect any changes when I refresh a page. Its like it doesn't update any code. The only way I can accomplish changes or updates, is to (essentially) run the site set-up each time, which involves running all the setup scripts, setting up the DB connections, etc. This is a total pain.
Question Is there any advice out there on doing this where I can just export the working root directory, to easily upload to server or other dev machine, without having to run those scripts over and over again. I know its something easy but I do not know exactly what to search for.
Is the a certain method for exporting directories/files that use symbolic links?
You might try using rsync instead of ftp to deploy the site. rsync will respect symlinks. Of course you will need have ssh access or mount the server over ftp/sftp with FUSE. If youre using SVN you could also ssh into the server and do an svn export or checkout.

Setup SVN/LAMP/Test Server/ on linux, where to start?

I have a ubuntu machine I have setup. I installed apache2 and php5 on it. I can access the web server from other machines on the network via http://linux-server. I have subversion installed on it. I also have vsftpd installed on it so I can ftp to it from another computer on the network.
Myself and other users currently use dreamweaver to checkin-checkout files directly from our live site to make changes.
I want the connect to the linux server from pc. make the changes on the test server until ready and then pushed to the live site. I want to use subversion also into this workflow as well. but not sure what the best workflow is or how to set this up.
I have no experience with linux, svn, or even using a test server, the checkin/out we are currently doing is the way I have always done it.
I have hit many snags already just getting what I have setup because of my lack of knowledge in the area. Dreamweaver 5 has integration with subversion but I can't figure out how to get it to work.
I want to setup and create the best workflow possible.
I dont expect anyone to be able to give me an answer that will enlighten me enough to know everthing I need to know to do what I want to do (altough if possible that would be great) instead I am looking for maybe a knowledge path like answer. Like a general outline of what I need to do accompanied with links to learn how to do it. like read this book to learn linux, then read this article to learn svn, etc., then you should know what to do. I would be happy just getting it all setup, but I would like to know what I am actually doing while setting it up too.
I'm sure you've solved your issue by now, but for future reference to other users, here's the steps I would suggest to get started:
Create a repository for your project (in Ubuntu)
Host the SVN repo using Apache
I'd read up on the subversion book to look at some strategies for development with SVN.
To connect to your SVN machine, you'll need to use it's IP or hostname instead of your svn live site you mentioned. With proper forwarding, it's easy to access it from anywhere.

Source Control Advice

I've inherited a significantly sized internal app at the company I work for. It has two parts. One runs on a LAMP server, the other runs on a WAMP server. There is no source control to be seen.
Currently, developers will log into each server via FTP and just directly edit the PHP files that are there. Or log into phpMyAdmin and make changes to DB schema where necessary.
What is the best way to implement some source control into this situation? I'm not very knowledgeable on how to best setup CVS ans SVN. Would all developers need their own "test system"? Meaning, would I have to setup a LAMP+WAMP enviornment for each developer? Or can they would off a central dev server? What is the best way to deploy changes that have been made?
Developers all use Windows. We also use Zend Studio 5.5 for development.
Thank you in advance for any advice.
It's really not a lot of effort for a developer to have a personal LAMP/WAMP running locally or in a VM. A local dev server is worth having for testing non-live changes in a closely matched environment but it doesn't really scale if all developers are making their changes on that at once.
I'd have all developers committing to trunk in Subversion and then have a stable branch which is automatically (using a post-commit hook) deployed onto the server. Only certain people should have write access to the stable branch to ensure a junior developer doesn't accidentally screw the live server.
That's a horrible way to work on websites, especially with a team. The whole setup should be changed.
The source code should live somewhere else, and then get deployed to the website when it's ready. You could have a script that does the deployment and whatnot (copy the files over ssh, plus any other setup if needed, etc). The point is: no one should ever edit files directly on the production server.

Is there a way to use SVN for web development in a Mac shop that uses coda?

So we are pushing to create good processes in our office. I work in a web shop that has been doing web sites for over a decade. And we don't use version control. I know! It's bad, not my fault. I'm the guy with a SoftE background pushing for this at a minimum.
The tech lead has been looking into it. We all use Mac workstations and mostly use Coda for editing since it is a great IDE. It has SVN support built in but expects it to work on local files. We're trying to explore mounting the web directory as a local network drive with an SFTP tool.
We are a LAMP shop, BTW.
I am wondering what the model is here. I think we have typically would checkout the whole site to our local machine where we have apache running and then test it there? This isn't how we work yet, we do everything on the server. We've looked at checking things in and out, but some files are owned by apache and the ownerships change when I check them in, because I'm not apache.
I just want to know a way to do this that works given my circumstances. Would be nice to not have to run apache locally.
You might want to checkout the Coda mailing list and ask there. Lots of Coda enthusiasts there with specific experience.
If you don't want to have to run locally could make Apache on your server run a copy of the site for every developer, on a different port per person, and then mount those web-roots to the local macs and make that the working directory. If you're a small shop that's not hard to manage. I find that pretty easy to set up and saves a lot of resources on the local machines. The one-site-per-person helps to avoid conflicts with multiple people working on files at the same time.
What I'd additionally recommend is to have a script that gets the latest changes from SVN and deploys the entire site to the production server when you're ready. You could have that script change permissions on appropriate files/folders as needed to be owned by Apache. The idea once you're using source control is to never manually edit the production files -- you should have something that deploys it from SVN for you.
A few notes:
Take a look at MacFuse / MacFusion (the latter is the application, the former is the library behind it) to mount remote directories via SSH / FTP as local ones.
Allow your developers to check out into their local environment (with their own LAMP stack if they're savvy), or look into a shared dev environment with individual jails. This way your developers can run their own LAMP stack (which you could deploy for them on the machine) without interfering with others.
The idea being, let them use a workflow that works best for them, to minimize the pain in adapting to this change (if change management might be an issue!)
Just as an example, we have a shared dev server where jails are created with a single command for new developers. They have a full LAMP stack ready to go, and we can upgrade and re-deploy jails easily to keep software up to date. Developers have individual control to add custom settings / extensions if they need it for work, while the sys admins have the ability to reset everything when someone accidently breaks their environment :)
Those who prefer not to use jails, and are able to, manage their own local environments (typically through Macports or MAMP).

Categories