Archive for the ‘Php’ Category.

phpinfo from the command line

PHP.gif

Display information about your php install on the command line with the following:

echo “<?php phpinfo(); ?>” | php | less
simple enough.
Edit: apparently php -i does the same thing.  Leave it to me to find the hardway.

How to setup a FAMP (FreeBSD, Apache, MySQL & PHP) server

freebsd.png

Software installed and functioning by the end of this walk through :

  • FreeBSD 7.1
  • Apache 2.2
  • PHP 5.2.8
  • MySQL 6.0.9

First off grab a copy of FreeBSD 7.1 from http://www.freebsd.org/where.html

Once you have FreeBSD installed we can start.

Continue reading ‘How to setup a FAMP (FreeBSD, Apache, MySQL & PHP) server’ »

Php Regular Expressions Cheat Sheet

PHP.gif

Basics of PHP #1

PHP.gif

You’ll notice we’ve been covering the basics of MySQL and Apache, we will also be covering the basics of PHP. And why under the server section? Databases and scripting languages don’t necessary make a server, but they are integral to the most common stack you find on the web, which is called LAMP. (Linux-Apache-MySQL-PHP).

The first thing we want to do is make sure we have the latest stable apache and php installed.

  • On Debian/Ubuntu: sudo apt-get install apache2 libapache2-mod-php5 php5
  • On Fedora (as root): yum install httpd php
  • On OpenSuse(as root): zypper in apache2 apache2-mod_php5 php5

And just to make sure apache is running: /etc/init.d/apache2 restart

Continue reading ‘Basics of PHP #1’ »