I Made Krisna's Times My Way to Write the Times

18Mar/110

Building PHP Webserver on Nginx with PHP CGI

Doesn't like the Apache webserver, nginx didn't have the auto-configuration feature from PHP and library loading. The way to make nginx be a PHP webserver is passing the request to PHP CGI. How?

The first step must be installing the nginx and php5 package. For this post i'm using Ubuntu 10.04 LTS.

apt-get update nginx
apt-get update php5

Check your nginx installation with start the service:

service nginx restart
/etc/init.d/nginx restart

Now, if the nginx working, let's connect it to the PHP CGI. First, run the PHP CGI so that the PHP listen at 127.0.0.1 with port 9000.

/usr/bin/php-cgi -b 127.0.0.1:9000 &

19Jun/100

WordPress 3.0 “Thelonious” Released

Source : http://wordpress.org/development/2010/06/thelonious/

Arm your vuvuzelas: WordPress 3.0, the thirteenth major release of WordPress and the culmination of half a year of work by 218 contributors, is now available for download (or upgrade within your dashboard). Major new features in this release include a sexy new default theme called Twenty Ten. Theme developers have new APIs that allow them to easily implement custom backgrounds, headers, shortlinks, menus (no more file editing), post types, and taxonomies. (Twenty Ten theme shows all of that off.) Developers and network admins will appreciate the long-awaited merge of MU and WordPress, creating the new multi-site functionality which makes it possible to run one blog or ten million from the same installation. As a user, you will love the new lighter interface, the contextual help on every screen, the 1,217 bug fixes and feature enhancements, bulk updates so you can upgrade 15 plugins at once with a single click, and blah blah blah just watch the video. :) (In HD, if you can, so you can catch the Easter eggs.)

15Jun/102

phpMyAdmin + PHP 5.3.x Blank Page Login

phpMyAdmin with PHP 5.3.x blank page login issue was the problem that bothering me for few times. Starts from when i want to update my PHP version from 5.2.12 to 5.3.1 then i got that error. I think that's the bugs from PHP 5.3.1 so i'm cancelling my upgrade to PHP 5.3.1

A few times passed, PHP releasing the new version, PHP 5.3.2 that i think php developers must have encounter that bugs because phpmyadmin is also main application that use php. But i got same problem there. After search on google and many experts blogs and references, i found some solutions to solve this problems.

27May/100

Removing ‘index.php’ from CodeIgniter URL

CodeIgniter is the one of most famous PHP Framework now. But if we're using CodeIgniter, by default the URL will be shown as http://localhost/index.php/welcome. Some people doesn't like this way to accessing a website, the index.php suffix in the URL.

Here is some step that can make us accessing the website using http://localhost/welcome. But we're also still accessing the url ith index.php suffix. Before, i will list my system so if we're using different system it may cause different solution.

  1. Apache 2.2.14
  2. PHP 5.2.12

STEP one : create .htaccess file

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /

#Removes access to the system folder by users.
#Additionally this will allow you to create a System.php controller,
#previously this would not have been possible.
#‘system’ can be replaced if you have renamed your system folder.
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php/$1 [L]

#Checks to see if the user is attempting to access a valid file,
#such as an image or css document, if this isn’t true it sends the
#request to index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
#This last condition enables access to the images and css folders, and the robots.txt file
#Submitted by Michael Radlmaier (mradlmaier)
RewriteCond $1 !^(index\.php|images|robots\.txt|css)
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>

<IfModule !mod_rewrite.c>
# If we don’t have mod_rewrite installed, all 404’s
# can be sent to index.php, and everything works as normal.
# Submitted by: ElliotHaughin

ErrorDocument 404 /index.php
</IfModule>

STEP two : edit CodeIgniter Configuration

$config['index_page'] = "index.php";

TO

$config['index_page'] = "";

That's all. Go and try that....

Source and References

  1. http://arifn.web.id/blog/2009/02/06/codeigniter-removing-indexphp.html
27May/100

CodeIgniter Code Completion NetBeans IDE

Sorry, but this post no longer works because of the references sites has been closed

CodeIgniter

CodeIgniter, this is one of PHP Framework that can make our job to do PHP Programming easier. You can get that CodeIgniter framework here [Download CodeIgniter]. At this written, the latest version of CodeIgniter was 1.7.2

The problem is if we're using CodeIgniter or other PHP Framework, the IDE like Dreamweaver or NetBeans cannot use their main features, Code Completion. What is Code Completion? That's the feature which can help us to show the functions or variable that can be used. Example if we just use native PHP on Dreamweaver, we just write "mysql_" then there's must be shown the functions which use "mysql_" prefix.

Thanks to Rakibul Hasan, my references of this post. We now can solve the problems, we can use code completion for CodeIgniter on NetBeans. How?

  1. Download the CodeIgniter PHP Framework
  2. Extract it on your Webserver so that you can run it a http://localhost/YOUR_CI
  3. Open your CodeIgniter project with NetBeans
    1. Click File >> New Project >> Choose PHP >> PHP Application with Existing Source
    2. Choose your CodeIgniter folder, example [C:\xampp\htdocs\ci] >> Next
    3. Choose your server type, leave it if you work locally
    4. Finish
  4. Check your CodeIgniter folder example [C:\xampp\htdocs\ci], there must be 'nbproject' folder
  5. Download the files from here [CodeIgniter Code Completion for Netbeans]
  6. Extract the .zip files anywhere
  7. Copy that files to 'nbproject'
  8. Close your NetBeans and Open it again... Finish, check it out!

On my experience, that code completion only works at Controllers and Models, not working at Views. For more information and question you can go to my references site.

Source and References :

  1. http://rhasan.com/blog/2009/09/codeigniter-auto-complete-with-netbeans/
  2. CodeIgniter.com