I had a task to read file from another server. Obvious you would suggest file_get_contents or cURL for same. But those files was not accessible through URL. I have to read it using FTP server credentials, Initially I was trying with ftp_get and some other FTP functions. But it was download all files to my local server.
But finally I got the solution, here its….
$filename = 'ftp://username:password@hostname/files/path/and/name.txt';
$handle = fopen($filename, "r");
$contents = fread($handle, filesize($filename));
I hope this would help you….
Magento shows blank/empty page, I was scared when this happened on one of the live site but after some exercises with source code and using internet I come to find out the solution. Most probably it could have memory issue or the compilation tool.
In order to troubleshoot the issue, your first step is to edit index.php, find out bellow line and uncomment
If its not available, insert this line somewhere at the top of the file and try out bellow solutions.
Try – 1 : Disable Complier
Go to System -> Tools -> Compilation and Disable you Complier and clear/flush magento cache data. In most of the cases this would solve the issue.
Try – 2 : Improve PHP Memory Limit
If you can access php.ini OR using .htaccess in the root OR edit index.php add bellow line right after ini_set(‘display_errors’, 1);
Try – 3 : Design changes
If you have recently installed new theme try to switch interface to a previously used one. Flush Magento cache after each operation. Magento will switch to default theme if it can not find a custom one.
I hope these would resolve your problem.
Use get_class to get the name of an object’s class.
<?php $class_name = get_class($object); ?>
Now, Use get_class_methods to get a list of all the accessible methods on an object
$class_name = get_class($object);
$methods = get_class_methods($class_name);
foreach($methods as $method)
A Way to check if a static block is enabled/disabled from the backend. This will returns true/ false.