Monday, May 17, 2010

Install GD on Mac with PHP

Reference:

1. start terminal
sudo bash

2. install libjpeg

mkdir -p /SourceCache
cd /SourceCache
curl -O http://.../jpegsrc.v6b.tar.gz
(http://www.opensource.apple.com/source/apache_mod_php/apache_mod_php-53/libjpeg)
(or download first, then cp /.../jpegsrc.v6b.tar.gz .)
tar xzpf jpegsrc.v6b.tar.gz
cd /SourceCache/jpeg-6b
cp /usr/share/libtool/config.sub .
cp /usr/share/libtool/config.guess .

(64-bit only)
MACOSX_DEPLOYMENT_TARGET=10.5 CFLAGS="-arch ppc -arch ppc64 -arch i386 -arch x86_64 -g -Os -pipe -no-cpp-precomp" CCFLAGS="-arch ppc -arch ppc64 -arch i386 -arch x86_64 -g -Os -pipe" CXXFLAGS="-arch ppc -arch ppc64 -arch i386 -arch x86_64 -g -Os -pipe" LDFLAGS="-arch ppc -arch ppc64 -arch i386 -arch x86_64 -bind_at_load" ./configure --enable-shared

make clean
make
mkdir -p /usr/local/include
mkdir -p /usr/local/bin
mkdir -p /usr/local/lib
mkdir -p /usr/local/man/man1
make install

3. Compile GD graphics library extension (gd.so)

- make sure which php version is using

mkdir -p /SourceCache
cd /SourceCache
curl -O http://.../php-5.2.11.tar.bz2
(http://us.php.net/get/php-5.2.11.tar.bz2/from/a/mirror)
(or download first, then cp /.../php-5.2.11.tar.bz2 .)
tar xjf php-5.2.11.tar.bz2
cd /SourceCache/php-5.2.11/ext/gd
phpize

(64-bit only)
MACOSX_DEPLOYMENT_TARGET=10.5 CFLAGS="-arch ppc -arch ppc64 -arch i386 -arch x86_64 -g -Os -pipe -no-cpp-precomp" CCFLAGS="-arch ppc -arch ppc64 -arch i386 -arch x86_64 -g -Os -pipe" CXXFLAGS="-arch ppc -arch ppc64 -arch i386 -arch x86_64 -g -Os -pipe" LDFLAGS="-arch ppc -arch ppc64 -arch i386 -arch x86_64 -bind_at_load" ./configure --with-zlib-dir=/usr --with-jpeg-dir=/usr/local/lib --with-png-dir=/usr/X11R6 --with-freetype-dir=/usr/X11R6 --with-xpm-dir=/usr/X11R6

make clean
make
make install

4. Add gd.so to PHP

- edit php.ini
-> add extension=gd.so
-> add extension_dir=/usr/lib/php/extensions/no-debug-non-zts-20060613

- restart apache
-> apachectl graceful


Friday, February 5, 2010

Install PHP + MySQL + PhpMyAdmin on Mac with Apache

1. activate web share

2. test apache by using test.html
- computer doc root /Library/WebServer/Documents/
- current user doc root ~/Sites/

3. test php by using phpinfo()

4. install MySQL

5. config MySQL
- /usr/local/mysql/bin/mysqladmin -u root password
- /usr/local/mysql/bin/mysqladmin -u root -p password
- sudo chmod 777 php.ini
- edit /etc/php.ini (using what ever editor)
-> session.auto_start = 1
-> session.save_path = /tmp
-> mysql.default_socket = /tmp/mysql.sock
-> mysqli.default_socket = /tmp/mysql.sock
- sudo chmod 444 php.ini

6. copy phpMyAdmin to computer doc root

7. config apache alias
- sudo chmod 777 httpd.conf
- edit /etc/apache2/httpd.conf
-> Alias /artmate "/<folder>"
-> <Directory "/<folder>">
-> Options Indexes FollowSymLinks MultiViews
-> AllowOverride None
-> Order allow,deny
-> Allow from all
-> </Directory>
- sudo chmod 644 httpd.conf

Friday, December 18, 2009

Apache httpd.conf example

Alias /asMgt/ "C:/folder/"
<Directory "C:/folder">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>

Monday, December 7, 2009

Flash Stage Size

Dreamweaver preset:
640 x 480 default = 536 x 196
640 x 480 maximized = 536 x 300
800 x 600 = 760 x 420
1024 x 768 = 955 x 600

Other suggestion:
1024 x 768 = 980 x 560
reduce the screen width by 40 and height by 200

Wednesday, December 3, 2008

PHP.ini

magic_quotes_gpc = On
mbstring.internal_encoding = ISO-8859-1

Sunday, December 30, 2007

Install MSDE 2000

1) Install MSDE 2000
setup sapwd= securitymode=sql disablenetprotocols=0

2) Enable TCP/IP connection
-> Start SQL Server Network Utililty
Start > Run > SVRNETCN
-> Enable TCP/IP

3) Add exception to fireware for TCP port
-> default TCP port: 1433

4) Register SQL server in Enterprise Manager

Saturday, July 14, 2007

Mobile Phone Information

*#06# to get IMEI code
*#0000# to get firmware version
default PIN code of Smartone is 1234
default PIN code of People is 8888 (not sure)