Did you verify that the webserver process (Apache for instance) has permissions to read outside of its DocumentRoot and that specific directory you are trying to access?
when i transfer my code into the server which is mac it won't work.
It helps to give some information about your environment and exactly what the error message is. It is easier that way for someone to help you.
For instance, it would help to know what webserver you are running.