Posts categorized “PHP”.

Virtual Hosts for PHP5 on OS X 10.5 Leopard

I just spent a good hour trying to work out why virtual hosts wasn’t working for me on my local machine. Turns out I needed to:

1) Enable virtual hosts by uncommenting the line

Include /private/etc/apache2/extra/httpd-vhosts.conf

in httpd.conf

2) Add the line

NameVirtualHost 127.0.0.1

to httpd.conf. I put it under the line

Listen 80

for now.

then…

Continue Reading… »

Pipe / Send Email to a PHP Script

Sending (or piping) emails to a php script would allows a whole world of fun. I had a spare 30 minutes the other night so I sat down, read a few blog posts and forums and set up emails to pipe to a php script.

Continue Reading… »

Delay Before Completion of File Load Solved

I was pulling my hair out this morning because although a css file I was loading was offering it’s contents immediately, the file didn’t complete loading to the browser for another 10+ seconds on each refresh.

Continue Reading… »

Magic Quotes – Quickly and Safely Removing Slashes

I have seen loads of ways of looping though GET, POST and COOKIE and stripping slashes, but I finally think I found one I am happy with.
The benefits it offers include…

Continue Reading… »

Location of hosts httpd.conf php.ini on Mac OSX

I’m sick of forgetting where to find my local development files so here is a quick breakdown. It includes hosts file, httpd.conf and php.ini

Continue Reading… »