Posts

Showing posts with the label PHP

Error in starting MYSQL in XAMPP

If you getting error in starting in mysql in xampp something like this error. Error: MySQL shutdown unexpectedly. This may be due to a blocked port, missing dependencies, improper privileges, a crash, or a shutdown by another method. Press the Logs button to view error logs and check the Windows Event Viewer for more clues If you need more help, copy and post this entire log window on the forums Answer:    Then Follow the step Rename folder mysql/data to mysql/data_old Make a copy of mysql/backup folder and name it as mysql/data Copy all your database folders from mysql/data_old into mysql/data (except mysql, performance_schema , and phpmyadmin folders) Copy mysql/data_old/ibdata1 file into mysql/data folder Start MySQL from XAMPP control pane Enjoy Now 😜😋

Simple Read XLSX and CSV file in PHP

 here is the code and the library file is attached below. Library File is here:- Download from here https://drive.google.com/file/d/1fNXtQQbmnII5P7_CZ4EUulaazoPfuz-b/view To Read CSV:  $FileURL = ' testfile.xlsx '; require_once "lib/parsecsv.lib.php"; $csv = new parseCSV($FileURL); echo "test<pre>"; print_r($csv->data); To Read XLSX:  $FileURL = ' testfile.xlsx '; require_once "lib/SimpleXLSX.php" $xlsx = SimpleXLSX::parse($FileURL); echo "test<pre>"; print_r($xlsx->rows());

add google map without api or embed google map using php code

we can add google map without using API or embed google map. Benefit:- No need to get headache for google map API Loss:- it will show the only map. it will not show the marker on the map. here is the given below code <iframe width="100%" height="auto" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="https://maps.google.it/maps?q= <?php echo $location; ?> &output=embed"></iframe> where $location is the address that will come through PHP or you can directly put a static

Cant use dump() function in twig files or how to enable debug in opencart twig or print_r alternate use dump() in opencart 3.0

if you are facing the following problem. Cant use dump() function in twig files  or  how to enable debug in opencart twig  or  print_r alternate use dump() in opencart 3.0 for fixing this problem follow these steps You can activate dump() function for twig environment by following these steps in opencart 3.0 : Go to system/library/template/Twig/Environment.php Here in the constructor function, you can find $options array . Set 'debug' option to 'true' . Now we need to include debug extension, so add $this->addExtension(new Twig_Extension_Debug()); below. Now you can use  {{ dump(your_variable_name) }} as print_r variable in php That's all 😅😆😛

How to test Ocmod extension or module xml file code in Opencart without installing?

Image
Answer : We can simply put our ocmod xml file in ROOT- > SYSTEM(folder) it will work. later on developer can install it in admin Extension->Extensioin Installer

maximum execution time error when importing sql data file since php.ini has been already set max execution time 3000

I am trying to import a large SQL data file using PHPMyAdmin in localhost This the config file for php.ini  max_exection_time : 30000 already set. but I still getting this problem. so I follow this step and now the problem has been solved. Solution:   There's a configuration variable within the phpMyAdmin directory that I find in  libraries\config.default.php  called  $cfg['ExecTimeLimit']  that I set according to my requirement now it has been fixed.

Code Difference between vqmod and ocmod in Opencart

   Vqmod Necessary Code Tags are:-         <id> Extension Name </id>    <version> 1.0.0 </version>    <vqmver> 2.1.5 </vqmver>    <author> Ravi </author>    2.  Ocmod Necessary Code Tags are:-          <name> Extension Name </name>    <version> 1.0.0 </version>    <link> http://opencart.devinlabs.com </link>    <author> Ravi </author>    <code> extension_uniq_code_name </code> ******** Major Differences between Vqmod and Ocmod *********** In Vqmod we Use  "Name" for the file full path but for Ocmod we Use "Path"                             i.e:- Vqmod =      <file name="catalog/controller/common/seo_url.php" error="skip">                          Ocmod =     <file path="admin/view/template/catalog/product_form.tpl">                                        in Ocmod and Vqmod

download an attached files with Anti-virus warning on Gmail

Image
I followed following articles and it working. Save email and open it in Outlook For other way follow these articles. http://www.barfuhok.com/how-to-download-a-file-with-anti-virus-warning-on-gmail/

Memory size exhausted Error in PHP, Opencart, Wordpress

Hi, I getting below error in my opencart website. :  Allowed memory size of 67108864 bytes exhausted (tried to allocate 20000 bytes) in  /home/xxx/example.com/system/library/image.php to solving this error. I added these below code after  placing it at the beginning of the file. and problem has been solved. ini_set ( 'memory_limit' , - 1 ); For detail information. I also followed this Q/A. http://stackoverflow.com/questions/1948561/problem-using-imagecreatefromjpeg-and-imagejpeg

Error: Maximum execution time of 30 seconds exceeded

Image
I was facing problem of this error. Since there is two type of cPanel  servers. Apache module ( In  " Apache module ", you can change your PHP settings via a .htaccess file  ) CGI Module (  you can change your local php.ini file in order to make modifications to your PHP setup. php.ini  ) My cPanel Server is  CGI so I tried all the php.ini file by adding these details:-  max_execution_time = 300 max_input_time = 600 memory_limit = 2560M upload_max_filesize = 100M but my problem was not solved. so I tried this rule. I added this code at the top of php script. that running the script for uploading or downloading ini_set('max_execution_time', 300); now my problem is solved.
STAR LOGIC Programming PHP  INPUT <?php for($i=4;$i>=1;$i--){ for($j=1;$j<=$i;$j++){ echo "&nbsp;\t"; } for($k=4;$k>=$i;$k--){ echo "*"; echo "&nbsp;\t"; } echo "<br/>"; } for($l=1;$l<=4;$l++){ for($m=1;$m<=$l;$m++){ echo "&nbsp;\t"; } for($n=4;$n>=$l;$n--){ echo "*"; echo "&nbsp;\t"; } echo "<br/>"; } ?>  OUTPUT         *        *  *      *  *  *    *  *  *  *    *  *  *  *      *  *  *        *  *          *