Best methodology for PHP+APACHE+MYSQL Development - php

I want to start learning PHP. I have had a look at the various options available to install the PHP+MySQL+Apache combination. But it all seems too cumbersome and a lot of editing to the CONF files always leads to one problem or the other. So I had a couple of questions to ask:
1) How will something like WAMP help me? If I install WAMP, will that be enough?
2) Isn't there some Eclipse like IDE ( coming from a Java Background ), that allows WAMP to be integrated with it? ( Or is typing on Notepad the only option available )?
Please help me out by explaining things a little elaborately. Thank you so much for your time and patience.

i personally use xampp and netbeans for my local web development. you can actually set up the netbeans project wherever you want, so you can just place all your files in the htdocs folder of xampp (at C:\xampp) and edit the files in the folder directly. This will allow you to immediately see any changes you have made by reloading the web page.
xampp allows you to run apache (with mod_php installed and configured) and mysql on your local machine and even includes a handy panel to let you start and stop them at any time.
netbeans has a lot of tools for easy development and support for frameworks like Zend. You can also use it for many other languages should you wish to expand.

I prefer WAMP because it doesn't try to do anything fancy with configurations... when you install it, you get PHP, Apache, MySQL, and phpMyAdmin with each of their default configurations and extensions loaded. It's the same as installing them separately, only they're all in one convenient directory, and you get the handy tray icon to restart services and enable/disable extensions.
As for an IDE, I use Eclipse PHP Development Tools (PDT), but I've heard good things about Netbeans too. Eclipse can do everything Scott described Netbeans being able to do as well. You also might want to look into Aptana which was branched from Eclipse PDT but is now maintained by a different team.

you can go ahead and install xampp from apachefriends, it comes with an apache web server, mysql database, phpmyadmin and a control panel for both servers, and installs fairly quick and with the default settings you will be pretty much set. Not sure what integration you'd want between the editor and the webserver though. if you mean code folding, autocomplete and all that stuff, eclipse has a php-friendly version, and so does netbeans (these 2 are the most popular choices as far as i've seen)

Related

Any working php debugger, PDT? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
Honestly, I am tired of searching and trying various php debuggers and IDEs from netbeans to jetbrains PHP storm, Eclipse indigo, WAMP, (old zend server community edition) etc!
I need a working set of IEDs and debuggers so I can start developing my work!( I by the way want to develop php scripts in Windows)
Problems:
php storm: weird IDE]
PHP Tools for Visual Studio: it says it is free, but you can try it for free for 30 days
PDT Eclipse: too old, no updates, broken links. Working with Zend itself is creepy
Netbeans 7.3, still not easy to work with. So many settings Xdebug not working
I need something like PHP development tools for Eclipse Juno, any suggestions?
What combinations of IDE(netbeans, phpstorm, Eclipse, Visual stodio) + (Zned server, XDebug) do you guys use? I am really tired of this product not being compatible with one another.
I would really give PhpStorm another try. True, it takes a bit of time to get used to, but it offers a lot of features that are hard to find in other IDEs
Regarding debugging and testing, read these walk-throughs on debugging:
http://confluence.jetbrains.com/display/PhpStorm/Zero-configuration+Web+Application+Debugging+with+Xdebug+and+PhpStorm
And unit testing:
http://confluence.jetbrains.com/display/PhpStorm/PHPUnit+Installation+via+Composer+in+PhpStorm
Simple Texteditor
Apart from a proper IDE, I always have a 'regular' text editor 'on the side', for example to have a quick 'scratch' file to write down some notes, or to make minor changes in a file without having to open your entire project.
There are many nice editors, Sublime Text, NotePad++ and UltraEdit are some examples.
Test and development environment
Although using WAMP/XAMP is convenient to set up, it is not the best environment to test your project. Most PHP websites will be hosted on a Linux/Using environment, which is quite different from a Windows environment in many ways, some are:
Linux/Unix file systems are Case Sensitive, whereas Windows is not
Linux/Unix uses a slash / as directory separator, Windows uses backslashes \
Some parts of PHP rely on functionality provided by the operating system. Therefore PHP will produce different results on Windows than on Linux/Unix
Linux/Unix uses a different permission system
If you develop and test your websites on WAMP you will encounter unwelcome surprises when you try to deploy the website on the actual hosting environment. Some problems may not even present themselves instantly, which will even be worse (customer calling in the middle of your Holiday telling you that the 'flush cache' admin-panel flushed not only the cache, but also all uploaded content)
So, in order to properly develop and test your website, your development environment should match the targeted hosting environment as close as possible
Inform with your hosting provider what their environment looks like; What Linux distribution are they using? (CentOS? Ubuntu?) What versions of PHP, Apache, MySQL?
Set up your test environment according to this. Either by setting up a development server and installing Linux on that, or running a Virtual Machine on your workstation, for example VMWare or Parallels Desktop (a virtual machine may save you some time, because many pre-installed, ready to use LAMP disk-images exist)
Client side testing
Preferably, make sure you have some computers or virtual machines with a clean install of your targeted audience (Windows XP, Vista? etc) sometimes a clean install is missing plugins/functionality that you assumed are present, causing problems (no Adobe Reader installed? No Flash? Old version of Windows Media Player?)
If your targeted audience are business users, be sure to test your website in the actual environment. Think of pitfalls like Caching Proxy Servers, Firewalls, multiple IP-addresses, disabled JavaScript and Thin Clients (using Remote Desktop). Sometimes those environments are still using Internet Explorer 7 (even 6) because of company policy.
Dreamweaver is by far the best php writting tool, the color code is amazing and the auto complete features are irreplaceable. The only other program i have seen come close in the field of auto complete is zend and that lagged like no other. plus it has built in ftp AND it makes it pretty easy to move on to javascript (IMO)
As far as server software i personally favorite WAMP, but everyone will have their own preference
you can find dreamweaver(trial) here
Wampp is here (pretty sweet webpage):
For PHP, I'd use Notepad++ all the way due to dynamic typing instead of static.
Notepad++ is quite light-weight and won't be in your way.
What sort of debugging do you need? Heavy unit testing and profiling or just print_r type of debugging? Have you tried http://www.firephp.org/ ? It's an extension to Firebug that works really well with AJAX.
There is no Eclipse juno PDT . The latest one is for indigo and that one crashes from time to time.
I use Dreamweaver and Xampp, and occasionally Notepad+++ and Xampp.
As stated in the thread, Dreamweaver has a great color code system and is very user friendly. I suggest it.
xampp
Notepad
I suggest use of Nusphere php ide , its too great for php, it has auto complete features and in built server and you can debug run time, you can also set browser foo debugging your code , its true php debugger, i am using this debugger since last 3years ,its amazing and it has inbuilt ftp feature so you can also debug your ftp file.
Here is link Nusphere

Optimal setup for OSX PHP development environment: MAMP + Eclipse + Subclipse + XDebug? Other?

I'm in the process of switching over to developing on a Mac (woohoo, new Macbook Air) after years of Windows. My previous PHP development setup was:
WAMP
NotePad++
XDebug
TortoiseSVN and WinMerge (linked to an Unfuddle svn account)
I've just installed MAMP Pro (evaluation copy of Pro), Eclipse for PHP Developers (Version: Helios Service Release 2, Build id: 20110218-0911), and Subclipse. I'm trying to get over the "new to Mac" hump at the same time as switching dev tools. Which is making me question my setup eleventy billion times more than usual. I've read lots of StackOverflow questions and answers, googled the heck out of dev environment tutorials. What I really want to ask is "PLZ tell me what to do to get a good dev setup on my pretty new Mac!" but since that's probably not a very well-formed question, I'll try to narrow it down some. (But if you get bored reading this question, and just want to point me to a good book or tutorial, FEEL FREE!)
MAMP: OK, I think I'm fine on this one, right? It's pretty much the defacto standard, if I don't want to hammer everything together myself from what came pre-installed on my mac. I'm probably fine with dropping $60 to get MAMP Pro, as developers I know have told me the long-term convenience is worth it.
IDE: I used Eclipse for several years... but for Java development in a Windows environment. Part of me is happy to get back to a full IDE after a few years of PHP in Notepad++. But do I want Eclipse for PHP? EclipsePDT? Something else? I picked the version I have based on several StackOverflow answers mentioning that EclipsePDT didn't necessarily play well with Mac.
SVN: I took the StackOverflow hive mind advice to install Sublipse for the eclipse integrated SVN plugin. Yay, it looks like it's working, or at least I can browse my repository.
Debugging: Zend Debug comes with MAMP, right? I've never used it, but I was only semi-happy with XDebug + Notepad++ on my Windows box, as it kept locking up and requiring a Notepad++ restart multiple times a day. Will I love Zend more? Should I stick to XDebug? (Or, wait, does Zend only work with Eclipse PDT?)
Now for the actual setup questions. Given that I've got existing Unfuddle SVN repositories, what's the best way to set up my dev environment? Put the source code into the MAMP htdocs directory, and point the eclipse workspace there? (recommended by many SO answers, IIUC) Vice versa, with code into the default eclipse workspace, and point MAMP to it? A separate Projects/myProject1 directory, pointing both MAMP and Eclipse there? I'm concerned that any of these options will work for the initial setup, but that I'll get deep into the work and discover that my debugger won't work for one configuration or another, or... I dunno, something I haven't thought of yet will cause a problem I could have avoided, if only I'd known.
OSX (also the client version) already includes everything you need to develop with PHP! Oh, and it's all 64 bit :) (on Snow Leopard and Lion)
Apache 2 is included by default and can be enabled from System Preferences -> Sharing (its name is "Web Sharing", or something similar: I'm sorry but I use OSX in another language!).
PHP is installed by default too. You just need to enable it in /etc/apache2/httpd.conf: uncomment this line:
LoadModule php5_module libexec/apache2/libphp5.so
MySQL can be installed from binary packages, downloaded from: http://www.mysql.com/downloads/
The only things you need to change in the php.ini file (/etc/php.ini) are:
pdo_mysql.default_socket=/tmp/mysql.sock
mysql.default_socket = /tmp/mysql.sock
mysqli.default_socket = /tmp/mysql.sock
You need to manually set the socket location for MySQL or it won't work with PHP.
Also, remember to set a value in date.timezone.
SVN and Git are installed automatically when you install the developer tools for Lion, which can be downloaded freely from http://developer.apple.com/mac (a free registration is required).
If you need Mercurial or if you aren't on Lion (so you don't have XCode 4), download the developer tools, then an application named macports, which provides ports for thousands common UNIX tools: http://www.macports.org/ . Once MacPorts is installed, you can install the required packages with a simple command:
sudo port install subversion
sudo port install git
sudo port install mercurial
I don't use any graphical tool for these SCM, so I can't really suggest you. I prefer the old, plain command line!
Developer Tools (the package with XCode) is required also if you want to use pecl to install custom extensions (the default distribution of PHP Apple ships doesn't contain some extensions like mcrypt, gettext and intl, just to name the three most important).
Speaking about editors... The one I really prefer and love is Coda. It's not free, but it's perfect if you want to develop in PHP: http://panic.com/coda/ .
It's also integrated with SVN (but we use Mercurial so I never used that option!).
For (S)FTP, I recommend you Cyberduck, which is free (open source): http://cyberduck.ch/ . Another really good client should be Transmit, but it's not fee (it's from Panic, the same company that produces Coda): I've never tried it (I'm really happy with Cyberduck!), but I heard thousands of good opinions about it.

Building a CMS in PHP: Development tools

I'm planning to build a CMS in PHP and MySQL, mainly for my own amusement and education. (Though who knows, I may come up with something useful and cool. Anything's possible.) I'll be asking questions about code architecture etc. later. For now, I'm more interested in development tools.
So far, all my playing with code has been done on a web server, and I've edited over FTP. I was thinking it might be quicker to use a localhost. Also, that way, I could use version control (which I've never done before).
So,
A. How do I set up a localhost server with many subdomains on an Ubuntu 9.10 computer. Is XAMPP for Linux the way to go, or should I use a standard Apache distro? (Or another webserver altogether?) For that matter, is it possible to set up more than one webserver on the same computer, and to use them for different localhost subdomains?
B. How do I set up a version control thingy covering all the code (which will be on several subdomains of localhost, and in a few shared folders)? I've read Joel Spolsky's HgInt tutorial, and it makes Mercurial look good. And simple, especially if you're working on your own.
C. Should I continue to use gEdit to write HTML/CSS/JS/PHP, or is there a better free editor out there for these languages?
A. Why would you use XAMPP when installing a LAMP stack is as easy as sudo tasksel install lamp-server? You can add as many domains to the configuration as you want using VirtualHosts for example (well theoretically anyway, in practice the amount will be limited by the available resources), you don't need multiple servers for that.
B. sudo apt-get install mercurial maybe? Of course, how to create a repository and add your projects is up to you - you should read the documentation of Mercurial.
C. Use Eclipse or NetBeans if you're planning to do any serious development work.
I'd recommend against using XAMPP, particularly if you're inexperienced as this would bypass all the package management functionality integrated in Ubuntu (so you need to manually track and apply security changes, if you need extensions not in the XAMPP distro you'll need to compile from scratch, similar for most of the external admin tools which might interact with the Apache install).
Yes - you can have lots of virtual hosts on the same webserver (rcently worked somewhere with 1200 named virtual hosts on each Apache webserver - start up took about 2 seconds rather than 0.5 - but after that you'd never have known the config files were HUGE).
If you're working on your own, then this is about the only scenario where using a distributed version control system offers no benefits over concurrent version control system, and a concurrent version control system offers no benefit over a conventional version control system. But even though it offers no advantage in the technology, it may be of benefit to you to acquire specific product skills.
What editor you use is matter of personal choice. Though personally I would list gEdit in my recommendations (I'd suggest NetBeans or Zend Studio for people who like standalone IDEs, otherwise vim, Eclipse, emacs).
A php documentor is (IMHO) a must (I like phpxref) along with some sort of testing toolkit.
HTH
C.
A: I've used Xampp for Linux successfully on Ubuntu. It's not hard to setup a normal apache installation, but I like the advantage of having a "temporary" web server where the changes are easy to reverse without affecting my normal installation.
If you want subdomains, configure apache to use virtualhosts.
B: I suggest subversion, but VCS is something of a religious issue. It doesn't matter what you use particularly. Once you've made a choice, then research the usage of a VCS.
C: Netbeans is much better than gEdit. That or Eclipse would be my preference. I use Netbeans under Ubuntu myself. A full IDE though will make development much easier than a text editor. Mostly because of code completion/integrated debugger.
I think stackoverflow.com is for programming questions. You'd want to ask those server questions on serverfault.com. Then again, they'd probably ask you to google it. Give it a try.
The editor question is cool. I use Kate, just because it comes with KDE and has syntax coloring.

Is there a true all-in-one solution for PHP Development?

I'm looking for a "SINGLE INSTALLER" solution for PHP Development.
Is there anything out there which will give me a nice IDE, Web Server, Debugger, Database, etc, on a single install image (*.msi or *.exe)?
This of course would be completely opposite of Eclipse PDT, which requires you to search and locate a bunch of additional components which never quite work together.
I think you should go for a separate install for server (web, database) and one for development (IDE, debug) -> Zend or PHPed ?
I think the question is: Does there need to be a true all-in-one solution? I think not.
I agree it's bothersome to have to put dozens of pieces together, but I find a combination of XAMPP, the IDE of my choice, and a few additional bells and whistles (like Polystyle for source code formatting) totally flexible, and not too much work to install.
I don't know if you'll find all of what you're looking for in one package for Windows, but you can get it narrowed down to about two...
XAMPP for Windows comes with: Apache, MySQL, PHP + PEAR, Perl, mod_php, mod_perl, mod_ssl, OpenSSL, phpMyAdmin, Webalizer, Mercury Mail Transport System for Win32 and NetWare Systems v3.32, Ming, JpGraph, FileZilla FTP Server, mcrypt, eAccelerator, SQLite, and WEB-DAV + mod_auth_mysql.
Then you just need an editor with a debugger, which there are many choices, mostly non-free, such as NuSphere's PhpEd - or free - such as Eclipse PDT or gVim+XDebug+DBGp client.
True one-in-all - not yet. Maybe someone reading this will upload a version.
My tip would be:
XAMPP and Netbeans (The PHP bundle).
2 clicks to install.
3 clicks if you don't have java installed already.
Netbeans is a nice IDE for PHP, too. I use it all the time and I'm much more satisfied with than with Eclipse PDT. It comes in one neat bundle, that you can just install and use right away.
Just download the PHP bundle here
As for a web server, I can recommend XAMPP or Zend Server. They are both easy to install and do a good job. XAMPP has MySQL on board while Zend Server has some really cool optimization features for great performance.
Should it be a requirement that your development environment is easy to install? You're a developer so, you should be able to install and configure a set of (more powerful) tools that suit your specific needs.
You'll only install your bundled IDE once (every so often) so that feature no longer is of benefit when you're developing your projects. It's more likely to become a hindrance as you struggle to configure your environment.
Take a look at Komodo IDE also.
If you're on windows you can get a WAMP package for web,php,database. For IDE I do like Zend Studio 5.5. Not their latest interation based off of PDT. 5.5 has a nice debugger and a built-in web browser that you can view output. The interface is pretty fast, running your code through the debugger/browser is slower than on a real webserver, but ofcourse you get the nice perks of breaking,inspecting your code. The only drawback is that Zend Studio 5.5 is not supported anymore and the highest PHP version that works with it is 5.2.13.
Currently though I have a Virtualbox Ubuntu Server image that mirrors my production enviroment, except it has Samba installed so I can easily copy files back and forth.

Help setting up php for Eclipse

I'm trying to set up Eclipse for php web development. What I would like to do is preview a php web page from within Eclipse, but I cannot figure out how to do this. Is there an integrated web server of some sort that allows this, or do I have to set up IIS/Apache to do it? If so, do I have to have my php files in the web servers path, or does Eclipse auto deploy the files to the local web server? Any information or links would be very much appreciated.
There is a plugin for Eclipse called PDT which makes PHP development a breeze.
For an overview on how to install it, you can refer to the Eclipse website:
http://wiki.eclipse.org/PDT/Installation#Eclipse_3.4_.2F_Ganymede_.2F_PDT_2.0
To actually view the PHP scripts running, I would imagine that you'd have to have some sort of server already installed and running. You could probably set the workspace location to be in the server path, and then view the files through localhost. But maybe the PDT package takes care of some of that for you.
I will make it Very Easy ;)
(1) Go to Eclipse home: http://www.eclipse.org/downloads/ and download Eclipse Classic (Current May/2013 version is 4.2.2)
(2)
One you have eclipse fired-up in you machine Do followings : Help > Install Software
Than, Click On Add
Finally, Add this link: http://download.eclipse.org/releases/indigo for all the list of Add-Ons
and pick PHP under Web Addon (Should be last in the list) and Install it.
Restart you eclipse + thumbs-up to my Ans. and Start Coding ;)
I setup apache/php/MySQL on my windows PC, so that testing environment is not totally unlike my servers (excepting the OS, but 90% of the time that's okay). I create alias's in the Apache configuration to the Eclipse workspace, and just hop between the browser and eclipse. The URL for testing is something like:
http://localhost/project_name/file.php
While this isn't ideal, it is a fairly consistent/smooth process that doesn't require a great deal of configuration within Eclipse. I keep thinking there should be a better way, but I honestly don't think I'm burning enough time to justify the research. Once the setup is done, I don't really loose more time after that, and I can control which version of PHP I'm running on my system.
I don't tend to like integrated browsers for testing of web applications anyway. Every time I've dealt with one, it was completely different from a "real" browser that I had to completely retest anyway. At least this way, I have my Firefox testing done when I'm through the first pass of the logic.
try easyeclipse, it the easiest Eclipse setup i've found
"EasyEclipse for LAMP:
For PHP, Python, Perl, and Ruby development with a web server and a database"
I would also recommend downloading and installing WAMP server which is a really easy all in one Windows equivalent (windows, Apache, MySQL, PHP) of what you are likely to have with a commercial web host. See http://www.wampserver.com for details and download.
As well as pdt which had already been mentioned other alternatives are phpeclipse and aptana studio which is based on eclipse.
Visit this website https://eclipse.org/pdt/. Go to where it says 'Update existing Eclipse'.
The procedure is this "In Eclipse, click Help -> Install New Software and work with *: http://download.eclipse.org/tools/pdt/updates/3.6"

Categories