Magento Admin Error when Logged-In
Posted by mkhairul - March 5, 2010 at 12:03:12 pm - 1 CommentCategories: Troubleshoot
An error message is displayed when logged into Magento’s Admin.
One of the errors is as follow.
lib/Zend/Locale/Data/id.xml:227: parser error : out of memory error
By default, Magento sets the memory limit to 128MB. Check the hosting’s memory limit (depends on where you are, most probably its going to be 32MB).
Change the value for php_memory_limit in the .htaccess file (in magento’s root folder) to the same value as the hosting.
Refreshing PHP.ini on IIS
Posted by mkhairul - February 17, 2010 at 03:02:34 am - No CommentsCategories: Troubleshoot
One of the SOAP script that I did is not working (it works fine when using apache), so I know its not the script’s fault (most probably its the php configuration). I’m using a PHP script for sending SOAP data to a 3rd party server. The data needs to be encrypted (mcrypt) using an IV (initialisation vector) provided by the vendor.
It also requires cURL to send data through an SSL connection (curl). I checked up on the php configuration and as I have suspected, mcrypt and curl is not loaded.
To enable the extensions, go to php.ini, and uncomment it (remove the semicolon). Reload the php.ini from IIS by recycling the application pool.
Start -> Run -> inetmgr -> ApplicationPools -> DefaultAppPool (Right click, Recycle)
Run a test script containing phpinfo() and check if the extension is loaded.
Reference
nuSOAP problem – Method not allowed
Posted by mkhairul - February 3, 2010 at 10:02:39 am - No CommentsCategories: Tips, Troubleshoot
I got a call from a friend working at the previous company that I worked for. I did the integration between their flagship application with a 3rd party payment gateway involving SOAP.
As usual, people call me expecting me to troubleshoot problem on the phone. At first I was a little bit confused as to what the problem is, but then I remembered that I had already solved it and went through my notes.
The web service client is calling the web service on SSL, it requires the use of cURL. Enable php_curl extension and everything should work fine.
Web Services (SOAP) limits
Posted by mkhairul - October 27, 2009 at 12:10:07 am - No CommentsCategories: Tips, Troubleshoot
I’m getting swamped by the task of making an application work with a vendor’s web services. Back in Al-Madinah International University, I did some web service stuffs but that was not an issue as it only sends small amount of data for each transaction.
But now there’s a need to send a lot of data (as much as possible) in one transaction. A single record is at least 500 bytes of data (with all the XML markups), I tried to test by sending an incremental amount of data (starting with 50 records) and worked my way up there, trying to get its limit.
The data is sent back and forth using ajax, when I get a 500 error, I knew it was caused by the amount of data that have to be put in a SOAP envelope.
With 1GB of RAM, I couldn’t even reach 100 records. I tore apart an unused PC in the office and got it up to 2GB and managed to reach 140 records (actually it is 150-160 but, I chose the average limit). Went off to the local pc hardware store and bought a 2GB ram stick. With a total of 3.24GB RAM, I tried it..
I tried sending 200 in one fell swoop and it works. Hopefully tomorrow I can test it more and see how it goes. In the quest to know more about Web Services, here’s some links that I have read.
- High Performance Web Services: Tackling Scalability & Speed
- Large Data Strategies
- Web Services Performance Consideration – Best Practices
- Discover SOAP encoding’s impact on Web service performance
- Improving Web Services Performance (patterns & practices)
- Checklist: Web Services Performance
- Best Practices for Web Service: Part 7, web services infrastructure
Refresh Desktop without restarting windows
Posted by mkhairul - September 12, 2009 at 06:09:18 am - No CommentsCategories: Tips, Troubleshoot, blog
I’ve been having this problem lately, when I leave my applications open too long (IDE, Browsers, etc) or open too many applications, my desktop starts to go insane. The icons are messed up, when I open explorer it doesn’t automatically display the left pane.
I need to refresh my desktop. Open up task manager, go to the processes tab, search for ‘explorer’ and end it. After the desktop is blank, no icons, just the wallpaper and the task manager, click on the File menu, new task (Run) and type in explorer.
And the desktop is restored!
Headers already sent in language file
Posted by mkhairul - March 12, 2009 at 05:03:35 pm - No CommentsCategories: Troubleshoot, codeigniter
I noticed that when I went to another page, there’s this weird character appearing for a moment. I can’t catch it using firebug or anything else. So I ignored it.
When I created a form and submit it, the controller redirects to another page and a warning appeared. Headers already sent. It points to my language file (I have an english and arabic file, but it points out at the english file). I looked through and there was nothing wrong with it.
I searched through CodeIgniter’s forum and found a solution for it. Opened up the offending file with Notepad++ and set the format as Encode in UTF-8 without BOM (Byte-order mark). So, when did I or anything adds this BOM to the file? Notepad++ handles this stuff well (which means it doesn’t add BOM automatically), but then I remembered I edited the file while using WinSCP (and many other windows programs including notepad), it must have added it.
Managing Programmers
Posted by mkhairul - February 26, 2009 at 12:02:14 pm - 1 CommentCategories: Troubleshoot, blog
I think How to Manage Geeks falls in the category of Job Relationship in the TWI (Training Within Industry) program.
Here’s what I would like to emphasize.
Recognize the outcomes of not treating geeks with respect.
Low Motivation ☑ CHECKED!
High Employee Turnover ☑ CHECKED!
Nowadays, good developers tend to contact other developers in the company before they join the company and what happens when there’s nothing good to hear about the company? They look elsewhere. High turnover but nobody to replace the vacancies will have a big impact on existing employees. They feel like they’re underpaid, while the foreigners and ‘consultants’ get paid alot.
Increased absenteeism ☑ CHECKED!
I too don’t feel like going to work but I can’t stand being bored at home.
Lower productivity☑ CHECKED!
I don’t know about this, but it seems the productivity is becoming low. Everyone do not want to give an extra effort at work.
Lower Quality
Currently the quality is quite high (thanks to DDD?). Everyone have pride in their work. I have a theory, when all the good programmers have left and the CTO doesn’t recognize good programmer. The newly hired will be so confused of the current system and when its time to fix a bug, they’d probably vote for a rewrite and everything will go down the drain.
Bad Service
Good service. Change requests are entertained.
The current situation is very dim.
Numbers are nice, interesting and important and can be used to run a company but we shouldn’t use it to run our people. When it comes to people things that matter are skill, pride, appreciation, confidence and cooperation.
Making jQuery selector/contains case insensitive
Posted by mkhairul - November 26, 2008 at 03:11:49 pm - 2 CommentsCategories: Troubleshoot, blog, code
Just another stuff from work. There’s huge list to select people to be put into groups in the LMS. I added a javascript function for the user to type in a name and it will search and select a user in the list box.
I use Selector/contains for this but the problem is, it is case sensitive. That’s gonna be a problem to type in the exact case from the list. Here’s a snippet to extend the selector.
jQuery.extend(
jQuery.expr[':'], {
contains : "jQuery(a).text().toUpperCase().indexOf(m[3].toUpperCase())>=0"
});
Took the snippet from StackOverflow, but it has a typo.
CodeIgniter 1.7 DBForge Error (Array to string conversion error)
Posted by mkhairul - November 20, 2008 at 11:11:13 am - No CommentsCategories: Troubleshoot, blog, code, codeigniter, php
I think the ellislab team is swamped with bug reports and stuffs. But I’m sure the next release will solve this problem.
I found this solution at the forum, CI 1.7 Forge Problems. Basically what you need to do is find DB_driver.php inside the database folder. Go to function _protect_identifiers (most probably on line 1193).
Add in this code (inside the function).
if (is_array($item))
{
$array = array();
foreach($item as $one)
{
$array[] = $this->_protect_identifiers($one, $prefix_single, $protect_identifiers, $field_exists);
}
return $array;
}
Alright, that should fix it up.
Debugging an SQL Query
Posted by mkhairul - November 12, 2008 at 11:11:26 pm - No CommentsCategories: Tips, Troubleshoot, blog, code
So, I debugged an error for a good friend recently. Only certain kind of item would be displayed, everything else was not found in the search. The first thing I suspect is the SQL Query. I printed out the SQL Query and tried to debug it.
The first thing I did is to arrange the SQL Query in a readable manner.
Since I do not have the time to follow the trail from the SQL Query manually, I just comment out 3 conditions at a time, and add a condition each time until the item was found. In the above picture, I’ve found the culprit its the one below the commented out line.
When I commented out the line, the results for the keyword appeared as follow.
So thats the divide and conquer part. So now I know the problem is with the commented out criteria and the one below it. I traced it back to its table (products_to_categories) and found out that the category_id value is empty. Thats why it can’t join in with the categories table and thus there’s no result.
So what did I do? I told my friend about the problem, explained it to him (I gave him a couple of screenshots to explain the problem) and gives him a solution. UPDATE products_to_categories SET categories_id = xx. So that all the item have a category and will be displayed when it is searched by the application.
Erm, yeah. Thats about it.
GimpStyle Theme design by Horacio Bella.




