Sunday, April 4, 2010

APPServ 2.6 + Window 7

Last week have been a googling week for me. 2 of the programmer are upgrading thier workstation into window 7. And php 6 finally hit the PHPer. However i had a few problem with APPServ 2.6 in window 7.

The first problem is unable to do connection to the localhost aka 127.0.0.1. And to solve this problem what i did is go to C:\Windows\System32\drivers\etc\hosts and uncomment the part where "localhost 127.0.0.1". I'm not really sure why microsoft put the default as comment. I think for some security reason.

The second problem is unable to do the connection to mySQL. Somehow the old authentication method does not work with the latest MySQl version.

  • Apache 2.2.8
  • PHP 6.0.0-dev
  • MySQL 6.0.4-alpha
  • phpMyAdmin-2.10.3

  • It something to do with the hashing way to keep the password security. As what i get from googling around the old MySQl version 4.x.x and version 5.x.x have a different bit of hashing. Could be something else they add on this new version.

    How to solve this problem :

    1. go to http://localhost/phpinfo.php
    2. Look under Apache enviroment, Look for SERVER_NAME. By default it will put the email address you filled in when u do the installation.
    3. Use the value in SERVER_NAME to log in into phpmyadmin. And left the password field empty.

    However another problem that i had is the privilages! even with the admin access level you can't even create a new database.

    So what i did is create a new user through MySQL cmd line, and grant all privilages to that account. It solve the problem for now!

    The findings that i get while solving this is :

    1. Editing the password using phpmyadmin will result the same error (unable to log in into mysql through phpmyadmin). So remove all the password or add them through cmd line. My theory is coz the phpmyadmin client (build on php5) have a different authentication method than the one this newest MySQL have, plus this version (6.0.4) are still on alpha stage.

    Tuesday, March 23, 2010

    Setting up svn Server

    My boss did ask me to set up csv for the use to monitor LOC for the programmers. Well i don't think LOC does matter much for a small scale projects. Unless it require a team member as much as 12 people like what we had on the 3 years project on my last company. So..i look around and i found about Subversion. Which recently become one of the project of APACHE (according to them the largest open-source community).

    Subversion used to be CollabNet's project but since February 2010( as by this date that i'm writing this entry just a month ago) it currently under the APACHE. Which i think a good news regarding that APACHE is a very active community. So in future they will be lot more update and that's mean i could google around the forum and my question can have an answer. :D

    So..i did try around a few way to setting up the subversion server, been spoiled with the Microsoft way of doing things , i look around for the most easiest way to do it.

    1. VisualSVN (http://visualsvn.com/server/getting-started/)
    2. By doing normal way. More information could be found here.(http://www.codinghorror.com/blog/2008/04/setting-up-subversion-on-windows.html)

    Oh i didn't mention the server is on Windows Server 2003 right? well it is on microsoft os so the link above is about installing subversion on microsoft.

    As for the client i use TortoiseSVN. It run as windows shell which mean u could use windows explorer and just right click to see the menu.

    Last 2 days i tried to set up the server using VisualSVN, they are free for standard edition and have to pay for some money for another version. But it cool coz it all-in-one softwares package. Somehow they set the port a lil bit diff than the conversational Subversion. I had a few error and seem like the tortoise can't make the connection to the server :(. So i revert to old way of doing things and follow the second instruction.

    The other thing that i learn is how to register the service on registry and service database. (yes i'm a total noob on this >.<). I did that a few times when i create a service when i was a .Net programmer. But u sure will forget stuff when u do that twice a year or so..

    I think the main problem which i'm having with VisualSVN is coz it a ssh+svn solution.And somehow they way to make it work a bit complicated.

    I'm trying to make this stuff as easy as it could for the programmer. For people who have 6 months to finish on lone project with minimal experience and skill, learning on how to use the other stuff that they probably won't use in future gonna take a toll on them. I've had been there and know how is that. Plus not to mention that they are underpaid. Compared to their peer at private sectors, programmer in government agencies are seriously underpaid, well other job as well.So the last thing i want now is pressuring them.

    Wednesday, December 2, 2009

    PHP and Stored procedures

    Having 3 years experiences of developing systems using .Net and been spoiled by it makes it a bit hard for me to change into open source worlds. So far i'm still struggling to make sure my knowledge on the open source technology is up to date. But each day i learn a bit of what open source can do, and amaze by how flexible it is.

    I did not write any past experience and knowledge that i gain for the past 3 years which something that i regret really much, but as for today and the next new year which coming very soon, i'll start recording all the things that i learn for that day. May this little essay will help me in future and so any who stumble upon this :D.Ok back to the topic for this post.
    Things that i learn today is using stored procedures with PHP.

    Why use stored procedures??My past experience in developing system really show me how stored procedures could prevents troubles in the futures.

    1. Security
    The precompiled sql script make it more secured rather than scripting it on the codes. Futuremore for open source where everyone can see codes behind, having the sql script on the codes is really like exposing the site secret weapons. Database is a spine for any system hence it should be handle with care.

    2. System performance
    First system that i develop once i start my working life is using ASP.net and oracle 9i. I really learnt a lot by doing the project.My biggest problem that i had while developing the web reporting is performance. My system running a very complex script on the client side which makes the page is taking more than 10 seconds to load. As for my experience the standard response time for the client to get the feedback from the server is 3 seconds.

    3. Feasibility
    Another good thing that we get by using stored procedures is it makes the programmer's work lots easier to change the sql script if any changes needed. Reading 3 thousands lines of codes to make changes on one lines of codes is not a fun things to do.


    It maybe lot more of benefits using stored procedures but so far this what i learnt by my past experiences.Using stored procedures also have a drawback, but for me the benefits out-weight it. Hence for next development that i will do on this University, i'll try to apply this and fully using it.

    Most common database the developer use while developing using PHP is mySQL, so i will start with this.The key word to use Stored Procedures in PHP is CALL. Yea..just use CALL than the stored procedures name at the back.

    Another thing that i learn is for other database, PHP have another class,PDO. according to http://us.php.net/manual/en/class.pdo.php , it '
    Represents a connection between PHP and a database server
    '

    I never really finish reading whole http://us.php.net/manual/.. It's like big dictionary which i use when i need to look for something. A few sites that i found helpful for this topics is

    1. http://www.joeyrivera.com/2009/using-mysql-stored-procedures-with-php-mysqlmysqlipdo/

    This one is what i refer most of time. The explanation is simple and easy to understand even for a newbie likes me.

    2. http://us.php.net/manual/en/class.pdo.php

    3. google it!! the best things about open source is you can find thousands of articles, forums and white paper to refer to. Come from industrial design background and jump into a programmer, i kept the habit of hating reading words and straight to numbers/codes/images.

    My first post

    This is the diary of things that i learn everyday. I was a programmer and still loves the job.