Skip navigation

Tag Archives: php

Drupal 6 node.save uses different methods for saving taxonomy for different taxonomy types.

For multiple select based taxonomy:

(php)

$nodeObj->taxonomy = array(2=>array(15,19));

(python)

nodeOb['taxonomy']['2'] = [15,19]

For tags based taxonomy:

(php)

$nodeObj->taxonomy = array(
  'tags' => array(
         2=>'military,navy'
   )
);

Nginx fastcgi cache with php-fpm can be a super fast of serving WordPress Mu.

Nginx WordPress Mu FastCgi_Cache Conf Rewrites are an interesting thing to get set up because of the cookie situation. You also don’t want to have wp-admin php files cached either. Read More »

There is an issue with Drupal 6 menu router rebuild which causes Drupal to time out with 404 pages or internal 500.

The following fix worked for me:

Install Drupal Tweaks, increase php memory, and mysql recommendations etc

http://drupal.org/project/drupal_tweaks

Download the following patches:

http://drupal.org/node/251792#comment-1831346


http://drupal.org/node/317775#comment-1491208

From command line copy patches to your root drupal directory.

cd to your root drupal directory and then apply the patches. Each time you will be asked where the file is for the patch and the actual path to the files to be patched will be provided in the command line. Just copy and paste each file path as presented into the prompt.


cp *.patch /home/drupal_directory/
cd /home/drupal_directory/
patch < no-router-blob-317775-56-D6.patch
patch < lock-251792-163-D6.patch

|--- includes/bootstrap.inc (revision 7577)
|+++ includes/bootstrap.inc (working copy)
--------------------------
File to patch: includes/bootstrap.inc

So in the above text you can see it gives you the path ‘includes/bootstrap.inc’. Just copy and paste that to where it says ‘File to patch:’. For each file it will provide you the correct path to the file assuming you are in the drupal root directory.

The final thing to do is to cp the lock.inc file which is created to includes/

I read this article on php-fpm init script but it didn’t have one.

You can use the php-fpm init.d script below. You need to change the variables at the start for your bin, conf, and pid to suit your set up.  PHP-FPM works great with Nginx.

Not sure if WordPress will format this script right so you can get as a text file here:

http://images.honewatson.com/random_files/php-fpm.txt

Read More »

Joomla 1.5 has an interesting quirk with Placehere Content Item Module.

Read More »

A simple tutorial on how to obtain geo coordinates with php and the Google Maps API.

Read More »

Update: Do not use this config for php.  Instead use php-fpm with xcache or apc.

To configure Nginx to load balance multiple FastCgi servers use this type of configuration:

upstream servercom {
server 127.0.0.1:44440;
server 127.0.0.1:44441;
server 127.0.0.1:44442;
server 127.0.0.1:44443;
server 127.0.0.1:44444;
}

location ~ \.php$ {
fastcgi_pass servercom;
fastcgi_index stream.app;
fastcgi_param SCRIPT_FILENAME /var/www/htdocs$fastcgi_script_name;
include /etc/nginx/fastcgi.conf;
}

Read More »

How to create an extract arrays in PHP.

Read More »

These code samples for the Ebay Trading API include some PHP.

Read More »

Here is the PHP Accelerator Toolkit for eBay – Trading API Edition.

Read More »