Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Whats a great dev setup for working with PHP + MySQL?

I've been a PHP Dev for many years now, and it just dawned on me that maybe I could be using better development tools.

For example, my typical setup for development is

  1. Notepad++
  2. Dev WAMP Server (local machine usually)
  3. CodeIgniter framework (lately I've fallen in love with it, as it speeds up deployment for me, big time.)
  4. phpMyAdmin (for MySQL of course).

If you are a PHP dev, whats your typical setup? Eclipse (too bulky for me at times)? etc;

I'm curious if I am missing something that might save me a ton of time, like some kind of on the fly PHP code validator (before I hit F5 and then debut what the error is). I currently achieve somewhat of a 'validation' by seeing the color highlights in Notepad++.

like image 622
Jakub Avatar asked Aug 19 '09 20:08

Jakub


People also ask

How do PHP and MySQL work together?

The PHP language provides functions that make communicating with MySQL extremely simple. You use PHP functions to send SQL queries to the database. You don't need to know the details of communicating with MySQL; PHP handles the details. You only need to know the SQL queries and how to use the PHP functions.

How use PHP with MySQL database with example?

php $servername = "localhost"; $username = "username"; $password = "password"; try { $conn = new PDO("mysql:host=$servername;dbname=newDB", $username, $password); // setting the PDO error mode to exception $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $sql = "CREATE DATABASE newDB"; // using exec() ...

Why MySQL is used with PHP?

MySQL is a first choice of PHP developers. As an open source Relational Database Management System (RDBMS) that uses SQL language, MySQL database helps to automate data retrieving and provide great support in PHP MySQL web application development.

How can I connect MySQL database in PHP using xampp?

Create MySQL Database at the LocalhostOpen your browser and go to localhost/PHPMyAdmin or click “Admin” in XAMPP UI. Now click Edit privileges and go to Change Admin password, type your password there and save it. Remember this password as it will be used to connect to your Database.


3 Answers

This is what works for me:

Server stuff (emulates my RHE deployment server):

  • Apache 1.3 and 2.2
  • mod_security
  • PHP 4 and 5
  • MySQL
  • MDaemon mail server (old 3-user version just for testing mail())
  • ImageMagick
  • ffmpeg

Code writing:

  • Notepad++
  • a custom command in shortcuts.xml to open the PHP manual on the selected function
  • another custom command to run PHP in lint mode (php.exe -l) on the code file
  • yet another custom command to run RATS scanner on the same
  • poEdit for I18N

Template editing:

  • Smarty
  • the Notepad++ User Defined Language file for Smarty
  • another custom command to run smarty-lint
  • my own Notepad++ autocomplete file for Smarty

Debugging code and templates:

  • Xdebug
  • the Xdebug Helper extension for Firefox
  • the DBGP plugin for Notepad++
  • WinCacheGrind for profiling
  • Firebug with FirePHP
  • modified Smarty debugger that outputs to FirePHP
  • dBug
  • Tail for Win32 to read the error logs in realtime

Database stuff:

  • HeidiSQL to manage MySQL
  • SQLite Manager for Firefox
  • ADOdb
  • MyEnTunnel for remote connections via SSH
  • rarely used: SQLite 2009 Pro, MySQL Workbench, DBDesigner4

Other useful stuff:

  • a Subversion server with TortoiseSVN and Winmerge
  • Keynote NF to store code snippets
  • Filezilla with Notepad++ set as default editor
  • Ndexer (modified to add support for Notepad++) for searching the code archive
  • the Regex Coach
  • Fiddler2 with JsonViewer
  • Nikto vulnerability scanner
  • PhpSecInfo
  • Doxygen
  • miniPHP Studio to make desktop applications with PHP

Almost all this stuff is open source and actually useful.

like image 98
djn Avatar answered Sep 27 '22 17:09

djn


As much as I hate Eclipse, I still use it because of it's ability to associate projects and provide the "jump into" functionality with F3. I'd really love an alternative, but Netbeans can't seem to get their intellisense working with the built-in PHP functions ("PHPDoc not found"), and I haven't found any other IDE that I like.

My toolset consists of:

  • Eclipse
  • Ultraedit (for quick editing and file/grep functionality)
  • Apache and PHP as separate installs
  • MySQL Administrator

I highly recommend MySQL Administrator... it's an excellent tool.

One thing I'll mention as well is my method of setting up web applications with Apache. I generally edit my hosts file and add an entry like this:

127.0.0.1   myapp.example.com

Then set up the apache config to have a <VirtualHost:80xx> on a separate port for each app I'm working on. With this method I never have any cookie-setting problems, and I can make each application accessible from outside my router by opening individual ports. This is great for showing clients the latest developments, but having full control over all the projects I'm working on. A simple config file controls the application's main URL, so when I'm ready to move code to production, a quick change is all it takes.

like image 22
zombat Avatar answered Sep 27 '22 16:09

zombat


Zend Studio is my favorite, it's built off of eclipse

like image 44
Ben Reisner Avatar answered Sep 27 '22 16:09

Ben Reisner