PhpED is PHP IDE that can be used on Mac OS as well as Linux and Windows Operating Systems. The solutions of PHP IDE on Mac from NuSphere are presented here. The option presented on this page describes running PhpED as PHP IDE on Mac with Wine.
|
|
|
Wine makes Windows PHP IDE run on Mac
Running PhpED on Mac and Linux is made possible by NuSphere development team thanks to the help and cooperation with our own users. Jesse Bacon (jessebacon at gmail dot com), one of the maintainers of Wine HQ (http://appdb.winehq.org/objectManager.php?sClass=version&iId=9946) did a terrific job setting up NuSphere PHP IDE run on Mac with Wine. Randy Casburn did the same for Linux and the results of their great effort are available here: http://appdb.winehq.org/objectManager.php?sClass=version&iId=9946
With Jesse's permission we published his tutorial for PhpED on Mac with Wine here as well.
Please note that while PhpED on Mac with Wine is now in public beta phase and you can download and try PhpED on Mac or Linux with Wine. NuSphere is in process of providing the support for the full set of PHP IDE features currently available on Windows. There is a list of known issues present in the current beta and currently being addressed by both NuSphere and Wine development teams. Known issues include non-working Srv - built-in web server, non-working help and some minor issues.
PHP IDE on Mac with Wine Tutorial
By Jesse Bacan (with minor edits by NuSphere staff)
Development environment:
- MacBook Pro
- 2.16 GHz Core2Duo
- 2 Gb RAM
- OS X 10.4.11
- MAMP (Mac, Apache, MySql, Php)
Mac Requirements
- Xcode tools from OS X installation disk
- X11 from OS X installation disk.
- Make sure to run Mac "Software Updates" after you install this.
Additional Requirements
- You need to have the latest build of Nusphere PhpED (5218 as of this writing)
Setting up WINE
- Download MacPorts 1.5 (this is essentially a package management application)
- Run the .pkg to install MacPorts
- After MacPorts is installed you need to update it (in terminal):
- After MacPorts has bee updated you can install WINE (in terminal):
- sudo port install wine
- This step take a fair amount of time because you are downloading the source and building it.
- Everything is stored under the /opt/local directory
- the WINE program can be found under /opt/local/bin after everything is installed
- Brief primer on WINE:
- creates ".wine" under your home directory where everything resides. In there you'll find;
- reg files where Registry information is retained
- "drive_c" folder where the main Windows "C:" drive is mimicked
Using WINE
- To use wine, you must do it from inside an X11 terminal
- Start X11 which is under /Applications/Utilities
- Basic syntax:
- path/to/wine /path/to/windows/executable inside an X11 terminal
- you can easily configure wine by typing in an X11 terminal:
- cd /opt/local/bin
- ./winecfg
- Before installing anything I suggest making sure there are additional fonts in the "~/.wine/drive_c/windows/fonts" directory (otherwise some fonts are garbled and unreadable)
- Wine doesn't create the ".wine" folder until you run it. So if you want to install additional fonts you need to run wine first so that the directory "c:\windows\fonts" will be there.
- I just ran "/opt/local/bin/winecfg" first so that it would create the necessary directories
- http://thisismyinter.net/?p=23 provides a good tutorial on installing additional fonts. I started with step 4 (the first three steps should not be necessary because macports has already installed some necessary dependencies - like fontforge).
Installing PhpED
- Open an X11 terminal
- /Applications/Utilities/X11.app
- In the terminal navigate to where WINE program is
- cd /opt/local/bin
- Technically, you can add this to your path
- export PATH=$PATH:/opt/local/bin
- Run the installer using wine
- ./wine /path/to/phped/installer
- I ONLY chose to install:
- After the installation is complete you can start phped.exe using wine
- cd /opt/local/bin
- ./wine ~/.wine/drive_c/Program\ Files/nusphere/phped/php.exe
- You can easily add a shortcut for PhpED in the X11 "Applications" menu
- With X11 open, click on Applications->Customize Menu from the menu bar.
- Click "Add" in the window that appears.
- Give it a menu name and then type "/opt/local/bin/wine ~/.wine/drive_c/Program\ Files/nusphere/phped/phped.exe" in the command section
- I did this for winecfg as well.
Configuring PhpED
- Start by setting the default debugger run mode to "HTTP mode"
- TOOLS->SETTINGS
- Under IDE Section
- Run & Debug - Default Run Mode
- While under "Run & Debug" check "Use custom port and host"
- Under "Debugger host" enter "localhost"
- I left the port the same
|
|
|
- When starting a new project:
- Wine creates mapped drive for you to use be default:
- C: maps to "~/.wine/drive_c"
- Z: maps to"/"
- I added an additional drive for my htdocs folder using the wine configuration utility
- /opt/local/bin/winecfg
- H: which maps to "/Applications/MAMP/htdocs"
- The root directory for a new project should be H:< project root >
- essentially "/Applications/MAMP/htdocs/< project root >"
- Under "Mapping"
- Run Mode -> "HTTP mode" //should be default
- Root URL -> "http://localhost/< project root >"
- Remote root directory -> Mac path to root
- "Applications/MAMP/htdocs/< project root >"
- Make sure that the PHP debugger is installed on you web server
PHP Profiler on Mac
Notes on working with PHPEd under WINE
- You can undock a tool window but you cannot resize IF you allow the window manager to control the windows
- This is the default setting in winecfg. You can change it by going to the graphics tab of winecfg and uncheck the option
- I recommend this as it speeds up screen redraw and tooltips for undocked windows are properly visible.
- To redock them simply double-click the "windows" title bar (not the X11 titlebar)
Uninstalling MacPorts
In the terminal:
sudo rm -rf \
/opt/local \
/Applications/MacPorts \
/Library/Tcl/macports1.0 \
/Library/LaunchDaemons/org.macports.* \
/Library/StartupItems/DarwinPortsStartup
Please note that this command removes all software installed using MacPorts as well as MacPorts itself. This includes configuration files for any ports which were installed; if you need to keep them, back them up before the rm (they should be in /opt/local/etc).
This command does not remove files installed to locations outside the agreed directory tree. Thus ports that write in other places should be removed manually before removing MacPorts altogether. This includes at least xfig and transfig, but probably other X11 ports as well.
For example:
sudo port uninstall xfig
sudo port uninstall transfig
In this tutorial you learned how to run PHP IDE on Mac with Wine. Additional technical information is available from the NuSphere Forum. Download a free trial of our PHP IDE for Mac, Linux and Windows today and make sure to check out other PHP Tools from NuSphere!
|