Posts Tagged ‘PHP’

PHP – zend install, zend start

February 22, 2010 4 comments

Zend framework? i will make it so  easy, that a just born baby can use it?

* Follow steps 1 ………6 sucks according to zend guide. :

* Follow steps 7 ……… rest works

1. [root@www html]# whereis php
php: /usr/bin/php /etc/php.d /etc/php.ini /usr/lib/php /usr/include/php /usr/share/man/man1/php.1.gz
[root@www html]#

2. [root@www ~]# ln -s /root/zend/bin/ /usr/local/bin/zf

3. [root@www ~]# php -i | grep include_path
include_path => .:/usr/share/pear:/usr/share/php => .:/usr/share/pear:/usr/share/php
[root@www ~]#

4. vi /etc/php.ini (change like this!)

[root@www etc]# grep include_path /etc/php.ini
; (directory must also be in include_path or full path must
;include_path = “.:/php/includes”
include_path = “.:/usr/share/pear:/usr/share/php:/root/zend/library
;include_path = “.;c:\php\includes”
[root@www etc]#

5. [root@www etc]# service httpd status
httpd (pid  4102) is running…
[root@www etc]# service httpd restart
Stopping httpd:                                            [  OK  ]
Starting httpd:                                            [  OK  ]
[root@www etc]# php -i | grep include_path
include_path => .:/usr/share/pear:/usr/share/php:/root/zend/library => .:/usr/share/pear:/usr/share/php:/root/zend/library
[root@www etc]#

6. [root@www etc]# zf –help
PHP Fatal error:  Cannot access self:: when no class scope is active in /root/zend/library/Zend/Tool/Framework/Provider/Signature.php on line 355

Fatal error: Cannot access self:: when no class scope is active in /root/zend/library/Zend/Tool/Framework/Provider/Signature.php on line 355
[root@www etc]#

Damn! incompatibility with centOS!! what i do what i do?
* why? because zend doesnt shift with latest php on it, and centOS doesnt shift also with, so using zend means get infected with mysql/php updates.

Read more…

Categories: centOS, Fedora 12, PHP, Unix/Linux, Zend Tags:

PHP – cakephp netbeans autocomplete zend framework autocomplete

February 20, 2010 Leave a comment

How to enable netbeans autocomplete for controllers/model ?

1. Load your cakephp project

2. Change as following

3. Done

Fig: cakephp sample

[OPTIONAL – tips]

#ALSO SUGGEST: Aptana use as a web development tool

#Loading zend netbeans, got

Dumping heap to /root/.netbeans/6.9m1/var/log/heapdump.hprof …
Unable to create /root/.netbeans/6.9m1/var/log/heapdump.hprof: File exists

So simply used, eclipse

Categories: cakePHP, PHP, Zend Tags:

PHP – gtk glib glade phpize php-config

February 18, 2010 Leave a comment

How to use php-gtk?

1. php-gtk2 we will use.

Categories: cakePHP, PHP Tags:

PHP – internationalization

January 28, 2010 Leave a comment

Internationalization cakePHP!:

*app/controllers/components/local.php >

1. /dev/2/app/views/news/index.ctp

echo _(“Hello world”);

2. xgettext we need in linux/unix , windows !

$xgettext -a src/*.php

*/ or

xgettext –no-location -j -L PHP —from-code=ISO-88591 `find ~/dev/2/app/views/ | grep ctp` `find ~/dev/2/app/controllers/ | grep php` `find ~/dev/2/app/ -maxdepth 1 | grep php`

3. messages.po :


# Copyright (C) YEAR Free Software Foundation, Inc.



#, fuzzy

msgid “”

msgstr “”

“Project-Id-Version: PACKAGE VERSION\n”

“POT-Creation-Date: 2009-12-08 19:15-0300\n”

“PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n”

“Last-Translator: FULL NAME \n”

“Language-Team: LANGUAGE \n”

“MIME-Version: 1.0\n”

“Content-Type: text/plain; charset=CHARSET\n”

“Content-Transfer-Encoding: ENCODING\n”

msgid “Hello world”

msgstr “”

4. messages.po to

$msgfmt messages.po -o





5. Now mention this

$locale = $language . ‘_BE’;

// default langauge


setlocale(LC_ALL, $locale);

// local/

$domain = ‘messages’;

// bindtextdomain($domain, “/var/www/html/cake/app/locale”);

bindtextdomain($domain, $_SERVER[‘DOCUMENT_ROOT’] . ‘/locale’);


6. On fly done.

Categories: cakePHP, PHP, Zend Tags:

PHP – rewrite

January 22, 2010 Leave a comment

RewriteRule ^edities/nl/([0-9-]+)/?$ /dn0/up/edities/nl/index.php?g=$1 [R=301,L]

RewriteRule ^a/? /hello  // means a == true or false

RewriteCond %{REQUEST_URI} !^/index\.php RewriteRule (.*) /index.php?$1

RewriteRule ^/?([^/]*\.html?|[^\./]*)[:;,\.]*$ /show.php?$1 [L,NS]

RewriteRule ^([0-9-]+)/?$ /dn/index.php?g=$1 [R=301,L]

Categories: PHP Tags:

PHP – pear

January 22, 2010 1 comment

Pear install
1. lynx
2. lynx -source | php
3. pear version
4. pear config-get php_dir

Package install:
[root@shamun ~]# pear search Spreadsheet
Retrieving data…0%
Matched packages, channel
Package Stable/(Latest) Local
Spreadsheet_Excel_Writer 0.9.2 (beta) Package for generating Excel spreadshee ts (.xls)

[root@shamun ~]# pear install Spreadsheet_Excel_Writer
downloading Spreadsheet_Excel_Writer-0.9.2.tgz …
Starting to download Spreadsheet_Excel_Writer-0.9.2.tgz (57,629 bytes)
…………..done: 57,629 bytes
downloading OLE-1.0.0RC1.tgz …
Starting to download OLE-1.0.0RC1.tgz (12,153 bytes)
…done: 12,153 bytes
install ok: channel://
install ok: channel://

[root@shamun ~]# pear list
Installed packages, channel
Package Version State
Archive_Tar 1.3.5 stable
Console_Getopt 1.2.3 stable
OLE 1.0.0RC1 beta
PEAR 1.9.0 stable
Spreadsheet_Excel_Writer 0.9.2 beta
Structures_Graph 1.0.3 stable
[root@shamun ~]#

Categories: PHP Tags:

PHP – How it behaves? ” ‘ {} ()

December 2, 2009 Leave a comment

# How it behaves  ”  and ‘?

$v_shamun = split(‘`’ , $__array[0][1]);

# How this behaves?  {} and ( )?

$_a_well =
“Content type: {$my_array}”

Output: Content type: array value \r\n

Categories: PHP Tags: