Categories
Mac

Mac Moves to PHP 5.3.6 With Release of OS X Lion

With Apple‘s release of OS X Lion, the bundled version of PHP has been updated to PHP 5.3.6, the very latest production version of PHP.

PHP 5.3 includes features like:

  • namespaces,
  • lambda funtions,
  • late static binding, and
  • a native mysql driver, mysqlnd.

This is good news for web developers using Mac. If we want to work the latest PHP release, we don’t have to resort to installing a separate version of PHP, using a tool like MacPorts.

Probably the fact that Lion is only available as a download through the Apple App Store has helped Apple ship with the latest PHP version.

Mac OS X 10.6 Snow Leopard currently uses PHP 5.3.4, even with the latest 10.6.8 update.

A PHP 5.4 Alpha has just been released, with useful features like traits. I wonder whether Apple will update to PHP 5.4 during Lion’s lifetime? I can only hope.

Categories
Mac

Mac OS X Lion: Useful Features, Compatibility, Upgrade Requirements, Install Time

Mac OS X 10.7, codenamed Lion was released on 20 July 2011. I’ve just upgraded my MacBook Air to Lion. Lion is … quite a lot of awesomeness bundled together.

On OS X Lion, even "About This Mac" is better
On OS X Lion, even "About This Mac" is better

Useful Features of Lion

Here’s some I love about Lion and am using all the time:

New cool stuff everywhere: There’s just great little touches everywhere. Even About This Mac is better, showing how much space different types of files are using on your hard disk, just like for an iPod when it’s plugged in for syncing to iTunes (see screenshot). I accidentally quit the Preview app without saving a screenshot. When I next started Preview, there it was waiting for me. All the Apple Apps now just pickup where I last left them. After getting really used to “the usual”, it’s quite exciting stumbling over all these useful improvements.

Full screen apps: Just click a two headed arrow in the top-right corner of a window, and it expands to take the whole screen, with the menu bar shrinking away. The major Mac apps have been upgraded to support full screen mode, like Safari, iPhone, iTunes, Mail, iCal, Preview and it works with some third party apps like Chrome. To sweep between full screen apps, just slide three fingers horizontally across the trackpad. Ahhhh – iPad like simplicity, just focus on one task at a time. And get the whole screen for useful work.

Scrolling reinvented: Scroll bars tend to disappear in Lion. In Safari and the Finder they’re not there until I scroll with the trackpad or arrow keys. The scroll bars fade in while I’m scrolling and quickly disappear. This gives more visible area for content, be it a web page or picture thumbnails in the Finder. So you don’t panic at the lack of scroll bars, the Lion welcome app makes sure it tells you how to scroll with two fingers on the trackpad. Two finger scrolling is in the opposite direction to Snow Leopard, matching the iPhone and iPad. (This can be reversed.) When you scroll past the end, there’s a bouncing effect also a la iPad. While there is an adjustment, it feels more tactile & intuitive. Basically Lion takes the best elements of the iPhone experience (focus on one thing, get the interface out of the way) and starts to bring this to the Mac.

Mission Control: Swipe up with three fingers and I can clearly see all my windows, full screen apps and the dock, with windows from the same app stacked together, and the app icon on the bottom edge of the stacked windows. Just click to pick which window you want. Quick, clear, easy, awesome.

Eye Candy: Lion improves the Mac’s graphical interface. It feels lighter & cleaner, more refined, yet more friendly. It not obvious. I can’t quite put my finger on the changes – the progress bar pulses and it lighter, window corners seem different sometimes, the shadows are better perhaps, Finder icons have been revised, elements slide, move, contract and expand… The elements aren’t obvious, but collectively Lion feels quite different to previous OS X releases.

Lion looks and feels different. It’s got more life in it. It’s simpler, lighter, more effective more fun.

Lion Application Compatibility

Application compatibility has been good so far. I’ve tested Firefox, Opera, Chrome & Outlook. I still need to test Word, Excel, Photoshop and the like. An app I use to stream music throughout my house – Airfoil – falls over after suspend, but I’ve got no doubt that will be fixed very soon. My PHP configuration got broken by the Lion upgrade, taking down a WordPress site I working on, but that’s fixed now.

How to Get Lion

Mac OS X Lion is available only through the Mac App Store. Go the the Apple menu, choose the third item down “App Store…“.

Requirements to Upgrade to Lion

You need to be running Mac OS Snow Leopard 10.6.6 or higher, and have 4GB of free disk space to upgrade to Lion.

Lion Download

Lion downloaded ridiculously quickly for me, at almost 10 megabytes per seconds. Apple’s obviously done the work so if you’ve got a fast Internet connection, they’ll use every bit of it.

Time to Install Lion

It took about 40 minutes to install on my MacBook Air 1.6 GHz Core 2 Duo.

Lion Pricing

Pricing is $29.99 in the U.S. and AUD$31.99 in Australia.

Performance

All the new Lion features respond smoothly & quickly on my late-2010 MacBook Air. My Air runs Core 2 Duo 1.6 GHz., which is a slow processor compared to current Macs like the mid-2011 MacBook Air with a i5 or i7. Macs made in the last couple of years should run Lion well.

Conclusion

I highly recommend upgrading to Lion! It’s a big upgrade to OS X with lots of useful improvements you’ll use daily. I’m meant to keep my MacBook Pro running Snow Leopard so I can test on Snow Leopard, but to be honest, I don’t think I can resist upgrading.

If you found this article useful please comment, or click the Tweet or +1 buttons – thank you!

Categories
Mac

Where are the Apache Configuration files on Mac? – httpd.conf

Here’s where to find httpd.conf on Mac. This is the httpd.conf location on Mac OS X 10.6 Snow Leopard and Mac OS X 10.7 Lion. This article also shows how to make the httpd.conf directory visible in the Mac Finder.

What is Httpd.conf?

Httpd.conf is the Apache web server’s main configuration file. Mac OSX ships with Apache installed. See Apache’s configuration docs for how to configure Apache.

Httpd.conf Location on Mac

On Mac httpd.conf location is in the directory /etc/apache2. You can access this folder through the Mac Finder or through the Mac Terminal.

Checked on OS X 10.7, 10.6.8, 10.6.7.

Httpd.conf Location in Mac Finder

You won’t normally see even the /etc/apache2 directory showing up in the Mac Finder. I tried looking in Macintosh HD, but /etc doesn’t show up.)

I found a tip at Codejacked on how to open hidden files in the Finder.

Here’s how to view httpd.conf’s directory in the Mac’s finder:

  1. In the Finder, click the Go menu, and choose Go to Folder…
  2. Type in /etc/apache2.
  3. Click Go.

The Finder will show the apache2 folder, and in it, you’ll see httpd.conf.

Httpd.conf Location in Mac Terminal

You can also get to the httpd.conf file through a terminal session, which is okay if your comfortable in the Unix shell (bash):

tazpro:~ taz$ cd /etc/apache2

tazpro:apache2 taz$ ls
extra		magic		original	users
httpd.conf	mime.types	other

Can’t Save Httpd.conf?

Httpd.conf is protected by OSX from being edited. If you open it with the TextEdit application for example, you won’t be able to save it. For details to bypass this security, see How to Easily Edit Httpd.conf on Mac.

Restart Apache to Apply Configuration Changes

Don’t forget you will need to restart Apache for your configuration changes in httpd.conf to be applied. To restart Apache on Mac:

  1. Go to the Apple menu and choose System Preferences.
  2. Click on Sharing.
  3. Untick Web Sharing.
  4. Tick Web Sharing.
Categories
Mac

How to Change a Mac’s Name in Four Clicks

Changing a Mac’s name is easy. Here’s how to change a Mac’s computer name is four clicks. A Mac name change will affect the name that other computers see when they’re browsing the local network.

I’ve tested this method on Mac OS X 10.7 Lion and Mac OS X 10.6 Snow Leopard (10.6.7 and 10.6.8).

The Mac computer name is sometimes called a network name,  or even a host name or hostname, which comes from OS X’s origins in Unix.

Here’s how to change a Mac’s name:

  1. Click and hold the Apple menu and choose System Preferences…
    To open the Apple menu, click on the Apple icon at the top left of the screen.
    The System Preferences window will open.
  2. Click the Sharing icon.
    The Sharing icon is about the center of the widow.
    It is in the row titled Internet & Wireless.
    The contents of the window will change and
    the window’s title will change to Sharing.
  3. Click in Computer Name field and type the Mac’s new name.
    The Computer Name field is at the top of the window.
  4. Click the red circle at the top left of the Sharing window.
    The Sharing window will close.
    Your Mac’s name will change.

You’re done! – The Mac’s network name is now changed.

The source for this article is Change Your Mac’s Name at Mac Crazy.

This method was tested on Mac OS X Snow Leopard 10.6 (10.6.7).

Categories
Taking Screenshots

The Easiest Way to Take a Webpage Screenshot

Do want to take a screenshot of an entire webpage, not just the part the webpage that fits on screen? This article describes how to take a full webpage screenshot using free software. This method will take a screenshot of a webpage, including the part below the fold. This method is automatic, and does not require manual scrolling.

This automatic method is much better than a manual scroll, shoot and stich process that many people still use:

  1. Take a screenshot of the visible part of the webpage.
  2. Scroll to the next part of the webpage.
  3. Take another screenshot.
  4. Repeat until there’s a screenshot of every part of the webpage.
  5. Manually stitch the shots together in Photoshop or Gimp.

The automatic solution is to use the Screengrab add-on for Firefox.

Here is an example screenshot I created using Screengrab:

Screenshot of an entire Google search results page
Screenshot of a full webpage

Screengrab can either copy the screenshot to the clipboard, or save the screenshot as an image file. Screengrab can screenshot a complete page, a complete frame, the visible portion of a page, selection of a page, or a window.

For more information about Screengrab, or to install it in FireFox, go to the Screengrab plugin page. Once Screengrab installed, just click the little icon at the bottom right of the FireFox window to take a screenshot.

If the page is very, very tall, when you save a screenshot image, it has happened to me that the PNG could be squashed vertically. Here is a workaround I use get the very tall screenshot in the right proportions on Mac:

  1. Screenshot the entire web page to the clipboard (instead of saving it to an image file).
  2. Open the Preview application.
  3. Choose File | New from Clipboard.
  4. The image will appear in the right proportions in Preview.
  5. Save screenshot from Preview in the image format of your choice.

Tested with Firefox 3.5 on Mac OS X 10.6 Snow Leopard, and FireFox 4.0 (4.0.1) on Windows 7.

Categories
Linux

How to See Hidden Files on Linux, Mac and Unix

Files and directory names starting with a dot are treated as hidden files on operating systems derived from Unix. That means you won’t normally see these dot files in Mac OS X, Linux, FreeBSD or enterprise Unix.

Linux includes Ubuntu, Red Hat, CentOS, SuSE, Debian, Fedora & Mandriva. Unix includes Enterprise Unix like AIX, HP/UX and Solaris.

Hidden files are typically used for configuration or program history. For example:

  • .bash_history contains a Unix user’s shell configuration.
    (A Unix shell is used to enter text commands.)
  • .ssh is a directory holding configuration files for SSH.
  • .bash_history keeps the history of shell commands entered.
  • .htaccess is used to override a folder’s Apache configuration.

Files are typically hidden so they don’t distract from the files people usually work with, such as documents, movies or music.

To list hidden files in a terminal session, add the -a option to the ls (list files) command. Here you can see the difference from a normal ls:

Tazs-MacBook-Air:~ taz$ cd /Users/taz

Tazs-MacBook-Air:~ taz$ ls
Backups		Movies
Desktop		Music
Documents	Pictures
Downloads	Public
Library		Sites

Tazs-MacBook-Air:~ taz$ ls -a
.
..
.CFUserTextEncoding
.DS_Store
.Trash
.Xauthority
.bash_history
.cups
.fontconfig
.lesshst
.mysql_history
.ssh
.viminfo
Backups
Desktop
Documents
Downloads
Library
Movies
Music
Pictures
Public
Sites

The cd command means change directory to.

There are two special files in this listing. The single dot file “.” is the current directory. The double dot file “..” is the parent directory. To see how this works:

Tazs-MacBook-Air:~ taz$ pwd
/Users/taz

Tazs-MacBook-Air:~ taz$ cd ..

Tazs-MacBook-Air:Users taz$ pwd
/Users

The pwd command means print working directory.

I’ve tested the commands above for working with hidden files on Mac OS X 10.7 Lion, Mac OS X 10.6 Snow Leopard (10.6.7, 10.6.8), Ubuntu Server 7.04, Ubuntu Server 10.10 LTS, Ubuntu Desktop 10.04, CentOS 5.1, 5.3 & 5.4, Red Hat Enterprise Linux 5.6, as well as ancient HP/UX, AIX and Solaris versions. They should work on nearly every Unix-based system.

Hackers sometimes hide files using dot files.

Nearly all file transfer programs provide an option to show hidden files. Dot files like .htaccess are essential for some websites to work. Dot files can be a security risk. Many file transfer programs show files starting with a dot by default.

If you have more questions about hidden files, please post a comment below.

Categories
Apache

Httpd.conf’s Location on CentOS, Ubuntu, Red Hat, Mac and Others

Here’s where to find the Apache 2 web server configuration file httpd.conf The httpd.conf directory differs across Linux & Unix variants like CentOS, Mac OS X, Red Hat, Ubuntu and XAMPP Mac.

This table lists the httpd.conf location for each operating system:

Operating System / Linux Distro httpd.conf Location
CentOS 5.2 /etc/httpd/conf/httpd.conf
CentOS 5.3 /etc/httpd/conf/httpd.conf
Mac OSX 10.6 Snow Leopard /etc/apache2/httpd.conf
Mac OSX 10.7 Lion /etc/apache2/httpd.conf
Red Hat Enterprise Linux Server 5.6 Tikanga (RHEL) /etc/httpd/conf/httpd.conf
Ubuntu 7.04 Feisty Fawn /etc/apache2/httpd.conf
Ubuntu 8.10 Intrepid Ibex /etc/apache2/httpd.conf
Ubuntu 10.10 Maverick Meerkat /etc/apache2/httpd.conf
XAMPP on Mac /Applications/XAMPP/etc/httpd.conf

For more specific information on Ubuntu, see httpd.conf location on Ubuntu.

The location for Fedora will likely be the same as CentOS (same distro family).

The location for Debian will likely be the same as Ubuntu (same distro family).

If your operating system or Apache package isn’t mentioned here, you can use the find command on Linux, Unix or Mac to find httpd.conf, e.g.:

find / -name httpd.conf 2>/dev/null

On Windows, you can use the search facility of Windows Explorer to find httpd.conf.

Additions & refinements welcome!