xampp interference with rails, django, other services - php

I have been running Django and Rails on my Ubuntu Linux system for a while, and I recently had to install XAMPP/LAMPP because I have to do some local PHP development. Back when I used to use windows, when I installed XAMPP it messed up my Rails environment. Right now I am getting LAMPP to work, kinda, but instead of the splash page that is supposed to appear I get the "It Works" Apache default.
Other posts on this site mention that this is probably due to conflicting instances of the Apache server installed on my machine, and I should uninstall all php, mysql and apache programs I had before, and then reinstall xampp.
However, I don't want this to mess up my development for Rails/Django, will it? I'm very cautious because it has messed me up in the past.
Thanks!

There is no real way to know for sure if anything will be messed up, why dont you try installing LAMP using the native packages as they will have better support than XAMPP. http://gregrickaby.com/2011/05/how-to-install-lamp-on-ubuntu-1104-natty.html
Since the Rails and Django development servers dont use port 80 then you should be fine installing Apache according to that guide.

Related

Do I need a Linux machine for back-end web development in PHP?

I do not understand fully how might the operating system have anything to do with something deployed on the web if you are not hosting the site locally.
Also, if I do not have a Linux machine, can I replace it by running WSL on my Windows PC? Or are there some fatal drawbacks that might point to not doing that?
No, you can develop PHP fine in Windows or MacOS.
You will have to install the right tools though like a webserver (Apache, Microsoft IIS, etc).
I good starting point is to use XAMPP.
PHP can be installed and run on Windows and MacOS as well as Linux and others - see https://www.php.net/manual/en/install.php for details.
Having said that, if you're planning to host the live site on a remote webserver which runs Linux, then developing that site on a machine which runs a similar operating system is likely to result in fewer unexpected compatibility issues when you deploy it to the live server. There are ways you can write the code in a cross-platform way (and 90+% of it isn't an issue anyway, there are just a few sticky areas mainly around files and paths etc), but there's always the danger of missing something.
If you prefer to develop mainly on Windows you could mitigate the above by having a virtual machine, or container, or by using WSL (Windows Subsystem for Linux), where you run tests against the site in a comparable environment to its live environment before deploying it to live. There are other resources already available such as this online which discuss the specifics of using PHP with WSL, if you want to pursue that.
No, you can do PHP development on any OS.
BTW I will suggest you to do learn linux in future.

PHP development without xampp

I have machine on which I lack admin privileges. I was not able to install xampp server on it. So I tried portable version of xampp. But I was getting error while starting Apache server and MySQL. The log file is not getting created.
Also many tutorials online use NetBeans which is also I am not able to install due lack of admin privileges.
I have postgres and apache tomcat working on my machine, which I used for Java Spring development. I also have eclipse installed on my machine. So I was thinking if I can manually configure eclipse, postgres, tomcat to develop php without installing xampp or netbeans.
Is it possible? If yes how do I do it? Is there any tutorial / link / webpage explaining the same?
If you can install jetbrains PhpStorm it has a built in server but due to lack of privileges i think it is not posiible though, so here are two links i have for you, hope you will able to find an answer..
https://www.eclipse.org/articles/article.php?file=Article-EclipseDbWebapps/index.html
https://www.enterprisedb.com/postgres-tutorials/how-connect-postgres-database-using-eclipse-and-netbeans
if you use php framework like laravel, cakephp etc.
Those have own development server to run application.
and for the database you can use sqlite database.
that not require xampp server

Issues with WAMP server after installing OSGeo4W

I recently downloaded WAMP server to get started developing a website locally on my Windows 7 32 bit computer. It was working fine.
Not long after, I downloaded a few different OSGeo4W packages mainly to use QGIS and develop plugins. This is when I began having issues accessing the phpmyadmin local host (page not found error).
I tried uninstalling WAMP in order to re-install it, and now it seems to be taking a very long time to extract files, blocking on the apache 2.4.9 files. Does anyone have any idea if this may be because OSGeo4 installed another version of Apache on my computer? How can I solve this issue?
This is because apache is already running via OSGeo4W application. You can turn it off by launching OSGeo4W-Apache-Monitor and stopping the services. (start/all programs/Apache/OSGEO4W-Apache-Monitor.
Then restart wamp and it should work fine.

Multiple versions of Apache installed and conflicting

I started trying to create a website which uses PHP on an old computer (previously used by another programmer).
I wanted to test my PHP code without uploading it each time, so I downloaded Apache and installed it. I was starting to set Apache up when I discovered this computer already had Apache on it.
Now I had multiple versions of Apache, so I went into add/remove programs and got rid of Apache (which only showed up once in the list).
Unfortunately windows decided it would uninstall the old version and keep mine which was not functioning properly. Also for whatever reason it seemed to have kept a good few files from the old version, but not enough that I could actually use it in any way. I believe it just had some configurations files.
I thought I would copy my files from the new version into the old version and not replace anything so hopefully I would be able to run under the older configurations, but that didn't work.
At this point I just wanted to cut my losses, so I put all the versions of Apache in an archive so there was no way the computer could be using them. I also removed Apache from the windows startup and rebooted the computer after configuring one single version of the newer copy of Apache to supposedly run PHP.
The problem is upon startup I could immediately log in to localhost and apache was already running. Also when I opened Apache manually from the files I had left unzipped, it only gives me the option to start Apache (not an option to stop or restart implying it is not running) and when I click it, it says "The requested operation has failed!" which is less than helpful.
So anyway, I just want to be able to run PHP locally and now I don't feel like I can even successfully uninstall and start from scratch anymore. Does anyone know what I have to do to get this to work? Sorry for the long description, I wove such a tangled knot.
One way to solve is use a XAMP (Apache + MySQL + PHP) client like XAMPP http://www.apachefriends.org/en/xampp.html brings it all set up for you to use. The problem of conflict can be caused by any IDE (Netbeans for example) that already carries a version of Apache.
Try to configure config files of Apache case exist.
Assumption: Running Windows OS for development and linux for production environment.
My recommendation is to not mix the Windows and Linux worlds as while they can be made to behave after lots of work, it is usually more pain than good.
Instead, as a humble windows and linux user, download and install Virtualbox [https://www.virtualbox.org/wiki/Downloads], a free open source virtualisation tool.
Then download a linux distribution of your choice and install that into a new virtual machine.
Configure the linux tools inside linux and leave your windows machine relatively untouched.
A useful linux service to install would be Samba - windows file sharing - you can use this to edit your code in windows using any IDE of your choice, while saving directly to linux and testing through linux. When happy, upload from the linux system (again like any other file uploader) and all will be well.
If you are deploying to a linux based environment in your production service then this will help you avoid common mistakes such as case-sensitivity trouble and many others.
Building and running this system is free and it will help teach you more about the linux environment you are deploying to also.
Equally, when you don't have the virtual machine booted, there's no services lying around exposing your computer to possible local network threats and consuming resources - as opposed to installing Apache on Windows where it will be using some resources all the time.

Proper Mac dev. environment with Rails and PHP

I've made a mess out of my MAMP setup. I used it all the time for WordPress and Drupal work, but now I want to try and learn Rails. After trying to get Rails installed, I now have 2 versions of MySQL competing with each other—and of course neither works anymore.
So: I'm wondering what the 'proper' way is to set this up so that they play nicely together.
Advice on setting up a 'proper' Mac OS development environment for PHP and Rails extremely welcome.
Thanks
Terry
Using Homebrew and RVM is the only way I recommend setting up a Rails environment on OS X these days. Homebrew gives you a really easy way to install and upgrade applications like MySQL, and RVM makes installing and working with Ruby a breeze. As far as working with PHP and Apache, you should be able to use the Homebrew MySQL install with the existing MAMP setup, as long as you turn off MAMP's MySQL server.
The only other thing you may need to do is install Apple's Xcode developer tools in order to compile the various packages.
Like someone wrote in the comments I will take the VM approach anytime. Just run a linux distribution in a virtual machine with all the modules you need. You can even run/ test different environments. Easy to setup/ upgrade/ replace and you don't have to fiddle around your working os.
I run osx (working environment) and a debian server installation in a virtual box as my webserver (running apache, php, mysql, rails). I switched over from a MAMP configuration and it saved me alot of stress and work (Think about upgrading different MAMP components, really is a pain sometimes)

Categories