PHP
PHP for Perl Users
print_r() - kindof like Data::Dumper()
- implode() == join()
pcre_match($pattern,$string,$matches) ~= $string =~ /$pattern/
where $matches is an array and $matches[0] in PHP == $1 in Perl- the concatenation character is the same '.'
php-mssql
Apparently, Redhat doesn't think it can use freetds/php-mssql for license reasons. Here's how I got it to work.
- Get latest php source rpm from an updates site
- install the source rpm
- edit /usr/src/redhat/SPECS/php.spec to build mssql.
Here's mine php.spec.fc7, and here's a patch php.spec.patch I copied the added mssql stuff is from Remi Collet's php-mssql spec file. (http://remi.collet.free.fr/rpms/SPEC/php-5.2.1-remi.spec)
- be ready to install a boat-load of devel dependencies
run rpmbuild -bb php.spec
You will probably have to install a bunch of stuff that the build depends on.
PHP-CGI
We run php through cgiwrap, so we use the php-cgi executable, not the regular php executable. The main difference is that php-cgi adds headers to your script output.
log_errors
When php is run from the command line, the log_errors setting does not actually log the errors, it sends them to STDERR, which really upsets web servers. Turn this off with:
ini_set('log_errors',0);or use ini_set to set 'error_log' to the name of a usable log file, or to 'syslog'
Pear
Set your umask! 0077 is bad! 0022 is OK.
Is like CPAN. Run pear search NAME to search and pear install --alldeps NAME to install.
