Header menu

_________________________________________________________________________________

Sunday 27 April 2014

Facebook javascript SDK returns undefined email in response


 

Facebook javascript SDK returns undefined email in response

Yesterday ,i was implementing login through Facebook option on my website . Initially everything went well . Then with no reasons facebook started returning undefined email ids.

If you are facing the same problem too , then there is two words solution for this . Add data-scope="email" in button.


Facebook javascript SDK returns undefined email in response

                                               I hope this will work for you too ..  :)

Monday 21 April 2014

Javascript autosubmit form Error: submit() is not a function



 Submit() is not a function. 

 

This error occurs in javascript while auto submitting form when there exist an input field with name submit or input of the type submit in the html form.

To remove the error just change the name from submit to something else .Then your form will work flowless.

 

Error :


Form  giving error:



Corrected Form: [name submit removed]


Friday 11 April 2014

InnoDB: mmap(137363456 bytes) failed; errno 12



* Error displaying the error page application instantiation error

* Error happens while site is running and mysql database  crashes . On reboot everything start working well again.

  Error logs

140410 9:16:44 [ERROR] Native table 'performance_schema'.'file_instances' has the wrong structure 140410
9:16:44 [Note] Event Scheduler: Loaded 0 events 140410 9:16:44 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.5.29-0ubuntu0.12.04.2' socket: '/var/run/mysqld/mysqld.sock' port: 3306 (Ubuntu) 140410 21:26:53 [Note] Plugin 'FEDERATED' is disabled.
140410 21:26:53 InnoDB: The InnoDB memory heap is disabled
140410 21:26:53 InnoDB: Mutexes and rw_locks use GCC atomic builtins 140410 21:26:53 InnoDB: Compressed tables use zlib 1.2.3.4
140410 21:26:53 InnoDB: Initializing buffer pool, size = 128.0M InnoDB: mmap(137363456 bytes) failed; errno 12
 140410 21:26:53 InnoDB: Completed initialization of buffer pool
140410 21:26:53 InnoDB: Fatal error: cannot allocate memory for the buffer pool
140410 21:26:53 [ERROR] Plugin 'InnoDB' init function returned error.
140410 21:26:53 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
140410 21:26:53 [ERROR] Unknown/unsupported storage engine: InnoDB 140410 21:26:53 [ERROR] Aborting
140410 21:27:08 [Note] Plugin 'FEDERATED' is disabled.
140410 21:27:08 InnoDB: The InnoDB memory heap is disabled
140410 21:27:08 InnoDB: Mutexes and rw_locks use GCC atomic builtins 140410 21:27:08 InnoDB: Compressed tables use zlib 1.2.3.4
140410 21:27:09 InnoDB: Initializing buffer pool, size = 128.0M InnoDB: mmap(137363456 bytes) failed; errno 12
140410 21:27:09 InnoDB: Completed initialization of buffer pool
140410 21:27:09 InnoDB: Fatal error: cannot allocate memory for the buffer pool
140410 21:27:09 [ERROR] Plugin 'InnoDB' init function returned error.
140410 21:27:09 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
140410 21:27:09 [ERROR] Unknown/unsupported storage engine: InnoDB 140410 21:27:09 [ERROR] Aborting 140410 21:27:09 [Note] /usr/sbin/mysqld: Shutdown complete
140410 21:27:10 [Note] Plugin 'FEDERATED' is disabled.
140410 21:27:11 InnoDB: The InnoDB memory heap is disabled
140410 21:27:11 InnoDB: Mutexes and rw_locks use GCC atomic builtins 140410 21:27:11 InnoDB: Compressed tables use zlib 1.2.3.4
140410 21:27:11 InnoDB: Initializing buffer pool, size = 128.0M
InnoDB: mmap(137363456 bytes) failed; errno 12
140410 21:27:11 InnoDB: Completed initialization of buffer pool
140410 21:27:11 InnoDB: Fatal error: cannot allocate memory for the buffer pool
140410 21:27:11 [ERROR] Plugin 'InnoDB' init function returned error.
140410 21:27:11 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
140410 21:27:11 [ERROR] Unknown/unsupported storage engine: InnoDB 140410 21:27:11 [ERROR] Aborting 

This error might occur in InnoDB in two situation :

1. When InnoDB unable to allocate memory as specified in innodb_buffer_pool_size variable




And then reboot the system. If your problem is not solved by these steps , then look for you swap file.

2. Swap file not present .If swap file is not present you can create it by

Wednesday 2 April 2014

Pass parameter to post method of file_get_contents()


If you are looking for some alternative to php cURL then file_get_contents is the function you are looking for. File_get_contents() is the  way to read the contents of a file into a string. We are going to discuss this function  as simple one to request data from server and then with post method to parameters requesting for some specific content. It is same as like CURL requesting server/service for some data.

In simplest form we can just pass url to function to get content of webpage:


To do more you can pass parameter as string to post method



At last passing array as parameter to post method of file_get_contents()