Saturday, 26 December 2015

Error shooting - PHP Warning: socket_bind(): unable to bind address [98]: Address already in use

problem:
-------------------------------------------------------------------------------------------------------------------

The problem occurs when you try to run you file(I am running a php client listen file) on server side,
this issue keep returning even after killing the process

PHP Warning:  socket_bind(): unable to bind address [98]: Address already in use 

for example: after running
# TOP
in server, find the process you want to stop, then
# kill $PID
then check the process, it was gone, in ideal situation. Okay, you won't found this process now, but when you try to run this file in you server, the error still exist.

So here is the solution:
--------------------------------------------------------------------------------------------------------------------

That error means there's something already listening on that port you're trying to listen on.
To find the culprit, use:
# netstat -tulpn
Then, after you made very sure you want to kill it, kill it, with either
# kill $PID
or, if that doesn't work, use the crowbar:
# kill -9 $PID


(replace $PID with the process id you want to kill)
#TIP: this is really useful to use netstat cammanf line to check current processes instead of top command line#

Monday, 14 December 2015

laravel5 php artisan migrate error


Problem:
----------------------------------------------------------------------------------------------------------------------
[PDOException] occurs when i try to running php artisan migrate in laravel5

looks like here:
MacBook-Pro:laravel5-project user$ php artisan migrate:refresh --seed


                                                    
  [PDOException]                                    
  SQLSTATE[HY000] [2002] No such file or directory  

Solution:
-----------------------------------------------------------------------------------------------------------------------
change host name in .env file
from:
DB_HOST=local host
to:
DB_HOST=127.0.0.1

It should be success when you try to run php artisan migrate again.

Thursday, 19 March 2015

An idea about create your own links anywhere, any message type

Here is my idea:

I wanna build a tool which is able to set your own links anywhere you want. It can be when you browse on BBC website, come across a special phrase, then you search on google, find the meaning for that, and you want to give it a remark so that review it next time when you see it.

Not just text from website, it can be any message type, like pictures, videos, even a song which type is mp3, you can still build a link for that.

So, this is something like bookmark, but it's much more power and useful than former one.

I hope anyone who is special interesting in my idea and able to develop this tool with me.

Moore Zhang

Saturday, 28 February 2015

HTTP Error 403.14 - Forbidden

HTTP Error 403.14 - Forbidden

The Web server is configured to not list the contents of this directory.


Most likely causes:

  • A default document is not configured for the requested URL, and directory browsing is not enabled on the server.

Things you can try:

  • If you do not want to enable directory browsing, ensure that a default document is configured and that the file exists.
  • Enable directory browsing.
    1. Go to the IIS Express install directory.
    2. Run /section:system.webServer/directoryBrowse appcmd set config / enabled: true to enable Directory browsing at the Server Level.  
    3. Run appcmd set config ["SITE_NAME"] /section:system.webServer/directoryBrowse / enabled: true to enable Level Directory browsing at the site.  
  • Verify that the configuration/system.webServer/directoryBrowse@enabled attribute is set to true in the site or application configuration file.

More Information:

This error occurs when a document is not specified in the URL, no default document is specified for the Web site or application, and directory listing is not enabled for the Web site or application. This setting may be disabled on purpose to secure the contents of the server.


Soluton: site.Master cannot be open, create a new form.aspx to use the master page!