简体   繁体   中英

Different result for same page on different ports : cakephp

I am new to cakephp, and following the 'Bookmarkers Tutorial'. I get to know that I can access the project using two kind of urls(I am using apache and the folder is located at /var/www/html/bookmarker):

localhost:8765

and

localhost/bookmarker

Now, when I use the first url, I get the following warning message on top:

warning(2) : file_put_contents(/var/www/html/bookmarker/logs/error.log): failed to open stream: Permission denied [CORE/src/Log/Engine/FileLog.php, line 133]

But is not the case with the second url !

Why is there such a difference b/w these two urls? Which one should be used? And how to resolve that message appearance? Any help is greatly appreciated!

It's two servers here. "localhost:8765" is the server built-in by CakePHP when you run the command: "bin/cake server" but you already have Apache web server at "localhost", so you don't need it.

And 2 servers being ran by 2 users:

  • localhost:8765 is you
  • localhost is apache

That's why you don't have permission to write log file (owned by apache) Just stop the server built-in (bin/cake server), and use Apache server (2nd URL)

In case you want to use the server built-in, stop Apache server and remove everything inside "/var/www/html/bookmarker/logs/", the error message will gone.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM