Wednesday, February 3, 2010

PHP trace error

Keyword
PHP trace error
PHP display error stack
PHP show error stack
PHP debug error
PHP show previous error

I believe many developer is well known of this, which is debugging your PHP code.

You might realize in WAMP (windows) the error display is at the current line.
Thus, if the error happen in a function tracking it down will be hard indeed since you dont know where the function is called.

To solve this problem, developer will use debugger tool.
In this case I will recommend Xdebug. http://xdebug.org/index.php

Here some screen shot on how the xdebug looks like


To install xdebug for window is pretty easy
1. Donwload the xdebug.dll file
2. Inside the php.ini, specifiy where you put the xdebug.dll file
3. Detail of the installation can be read at the xdebug documentation itself

good luck, kupo

Wednesday, January 20, 2010

phpmyadmin blank page too many table

If you were developer and just installed a WAMP in your machine.

There might be a problem where the phpmyadmin page goes blank after when you select the database.

And if you observe, this only happen when the number of table is too many.

Like this,


This problem is actually because of the setting in your php.ini config file

The setting title is called "Resource Limits". Search for this "Resource Limits" inside the php.ini and change to this.

You can set anything as long as its more than the default.
max_execution_time = 60
max_input_time = 60
memory_limit = 256M


After that, restart the WAMP and its solved.

This problem occured on WAMP5 Version 1.7.0

Notepad 2

Probably many ppl didnt know about "abit advance" version of notepad.
Its lightweight and almost similar to notepad.

Mostly, it is used by developer for quick editing.
As for me, i like it because its support syntax highlighting and show a line number

Here is where you can download it HERE

Some screen shot

Tuesday, January 12, 2010

Using FTP client

In this page, I will simply teach how to use FTP (File Transfer Protocol).
Its allow you to download and upload a file into another computer.

And of course, the permission to download or upload is determine by the another computer. Lets called it as server.

First of all, is the tool required to use this FTP.
In this case I will be showing using Mozilla Firefox 3.5.7 and Core FTP Lite.

Using Mozilla Firefox
Its simple, just type the ftp URL in the URL bar. Eg: ftp://abcxyz.com.my/
Please note that Mozilla Firefox is only a client. Thus, you can only download a file from it(not upload)








Using Core FTP Lite (free edition)
First of all, download the software first
http://www.coreftp.com/
http://download.cnet.com/Core-FTP-Lite/3000-2160_4-10256215.html



Once Install. Run the software and you may have something like this



Go to the Menu > File > Connect.
The ftp server is ftp://abcxyz.com.my/. Thus, inside the HOST/IP/URL is “abcxyz.com.my”.
The username and password is depends.
After all the setting, click “Connect” button.
To use the Core FTP is also easy. Just need to drag and drop for download or upload



Conclusion
This is a simple tutorial on how to use. There is also a lot of stuff that I didn't know. Google might help.

Please note that the exact FTP link is not.
See this website http://www.cs.tut.fi/~jkorpela/ftpurl.html to see the FTP real URL format.
Well, its like this ftp://user:password@host:port/path

Thursday, January 7, 2010

Flashblock

Flashlock is a Firefox add on that used to block all type of flash player.
Its let you to determine by your own to run the flash or not.

Benefit
Improve your internet speed since less data is loaded into your website page
Disable annoying advertisement

How do I get this?
Its in the Firefox add on website. Just search for "Flashblock"
Or simply click HERE
The installation should be easy for Firefox.

Here some example

Flashblock on FF Addon



Flashblock on the run

Friday, January 1, 2010

Disable yahoo messanger advertisement

Im using yahoo messenger 10. and this is how I disable their advertisement. AND ITS WORKING!

Please note that I have try many other way by googling such as editing the registry file and also downloading the tweak application.

And this method is available through many website either. So I just copy and paste the link HERE

Basically
At C:\Windows\system32\drivers\etc\hosts. Open the "hosts" with notepad.
And add "127.0.0.1 insider.msg.yahoo.com"

Please not that this method can also be use to disable a lot of thing. Once I saw they use it do disable the Adobe Professional pirate version from being black listed

Thats all,
Hope its useful... guess not

Friday, October 16, 2009

Install LAMP on ubuntu

its 1st time use ubuntu = tension

Install LAMP in ubuntu = haih...

I have moved the latest update to here http://asipi.blogspot.com/2011/03/install-lamp-on-ubuntu.html


1

Install apache & mysql & phpmyadmin : here

*Update 23 Jan 2010
My Software source was from Malaysia and it has problem!. So it set my source to "Main Server" (Software source download from Main Server)


2

Enable the www folder
This will make your be able to add new folder into the localhost
using terminal : sudo chmod 777 '/var/www'
Please note that /var/www is your root for the website
/var/www/smellynomore means http://localhost/smellynomore


3

You will realize that u cant open the phpmyadmin on http://localhost/phpmyadmin
This is because when you see inside /var/www there is no "phpmyadmin" folder
I solve the problem by referring here
Solve by doing this in terminal : sudo ln -s '/usr/share/phpmyadmin' '/var/www'


4

Additional configuration for the mysql
When you first time install the mySQL, everything is working fine.
But then, after you reboot the PC, the mySQL server cant start.
The mySQL configuration file will be missing after boot
After some haih...checking, you will realize that file inside "/var/run/mysqld" is missing
I solve by referring here at try to chown to "mysql.mysql" if owned by root, and give it a 755
Its because of the folder write permission

How to chown and chmod, please note that I dont know what happen to security issue when I done this, just want to 'make it work!'
sudo chown -R asipo '/var/run/mysqld'
sudo chmod -R 777 '/var/run/mysqld'



5

Load the mod_rewrite module
I google here to solve...
Using terminal :
1) sudo a2enmod rewrite
2) sudo gedit /etc/apache2/sites-enabled/000-default
3) Change AllowOverride None to AllowOverride All
4) Restart Apache: sudo /etc/init.d/apache2 force-reload


6

Additional

Command to mySQL server (check, start, restart and stop)


Setting up the cakePHP 1.2.5
There will be 2 problem
1. Warning (512): /var/www/cakemake/app/tmp/cache/ is not writable [CORE/cake/libs/cache/file.php, line 262]
2. Your tmp directory is NOT writable.

Solve by : Once again chmod 777 is not secure, yeah!
sudo chown -R asipo '/var/www/smellynomore/app/tmp'
sudo chmod -R 777 '/var/www/smellynomore/app/tmp'



7

Install x-debug
http://ubuntuforums.org/showthread.php?t=525257

EDITED #2 (Feb 2011)
I dont know why lately my xdebug does not working. So I edit the php.ini file
I make the all to be "Deleopment mode" because its defaulted to "Production mode"
So I guess that is the reson, plus use this on ERROR Report
error_reporting = E_ALL & ~E_DEPRECATED & ~E_NOTICE


8

After that, it will read index.html
I dont know how to change it for the thing to refer into index.php

However, this is the index.php code (simple version of mine)

<p><b>Localhost</b></p>
<p>Select folder or file to navigate</p>

<?php

echo "<ul>";
if ($handle = opendir('.')) {
    while (false !== ($file = readdir($handle))) {
        if ($file != "." && $file != "..") {
            echo "<li><a href='$file'>$file<a></li>";
        }
    }
    closedir($handle);
}
echo "</ul>";
?>

If you have been wandering how I put this code into this blog. This is the place http://asipi.blogspot.com/2011/01/write-blog-post-using-tinymce.html

Thus when you open your http://localhost/index.php will get something like this

Thats all
good luck, kupo!