prashants / webzash

Easy to use web based double entry accounting software in PHP - MySQL under MIT License
http://webzash.org
Other
207 stars 109 forks source link

Missing Controller : Error: Webzash.WebzashController could not be found. #150

Closed jessicana closed 2 years ago

jessicana commented 2 years ago

Hello, I get the below error, how can I fix it?

Errors
Missing Controller
Error: Webzash.WebzashController could not be found.

Error: Create the class WebzashController below in file: /var/www/domain.com/html/directory/webzash/app/Plugin/Webzash/Controller/WebzashController.php

<?php
class WebzashController extends WebzashAppController {

}
Notice: If you want to customize this error message, create app/View/Errors/missing_controller.ctp

Stack Trace
APP/webroot/index.php line 117 → Dispatcher->dispatch()
ROOT/index.php line 41 → require(string)
alt + aChart of Accounts
alt + eAll Entries
alt + lAdd Ledger
alt + rAdd Receipt
alt + pAdd Payment
alt + cAdd Contra
alt + jAdd Journal
Powered by Webzash v3.0
prashants commented 2 years ago

Are you using it online or locally ?

jessicana commented 2 years ago

Online. I run my website in the root directory on Ubuntu 20.04.2 LTS, nginx/1.21.1, and PHP 8.0.9. MySQL Ver is 8.0.26, and I want to install it in the subdirectory.

prashants commented 2 years ago

Maybe conflict with .htaccess in the parent directory

Pls try running locally using a WAMP/LAMP stack installer to test.

https://bitnami.com/stack/wamp/installer

On Wed, Aug 18, 2021 at 9:39 AM jessicana @.***> wrote:

Online. I run my website in the root directory on Ubuntu 20.04.2 LTS, nginx/1.21.1, and PHP 8.0.9. MySQL Ver is 8.0.26, and I want to install it in the subdirectory.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/prashants/webzash/issues/150#issuecomment-900797019, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAQULDVWZIDTJ7BZ4Z5HY3T5MW67ANCNFSM5B7W3UXA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .

jessicana commented 2 years ago

Nginx doesn't support .htaccess. Check this article, please. I use LEMP stack. Have you tested the installation on LEMP stack and is it required that users only use LAMP stack?

prashants commented 2 years ago

Sorry I haven't tested it with Nginx. Issue is with cakphp 2.x and nginx setup. Maybe try this...

https://book.cakephp.org/2/en/installation/url-rewriting.html#pretty-urls-on-nginx

On Wed, Aug 18, 2021 at 7:06 PM jessicana @.***> wrote:

Nginx doesn't support .htaccess. Check this article https://www.nginx.com/resources/wiki/start/topics/examples/likeapache-htaccess/, please. I use LEMP stack. Have you tested the installation on LEMP stack and is it required that users only use LAMP stack?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/prashants/webzash/issues/150#issuecomment-901121254, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAQULAPEFO4IVTI4QMDWA3T5OZMZANCNFSM5B7W3UXA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .

prashants commented 2 years ago

https://blog.webnersolutions.com/how-to-install-nginx-and-configure-it-for-cakephp/

Try this also

On Wed, Aug 18, 2021 at 6:11 PM Prashant Shah @.***> wrote:

Sorry I haven't tested it with Nginx. Issue is with cakphp 2.x and nginx setup. Maybe try this...

https://book.cakephp.org/2/en/installation/url-rewriting.html#pretty-urls-on-nginx

On Wed, Aug 18, 2021 at 7:06 PM jessicana @.***> wrote:

Nginx doesn't support .htaccess. Check this article https://www.nginx.com/resources/wiki/start/topics/examples/likeapache-htaccess/, please. I use LEMP stack. Have you tested the installation on LEMP stack and is it required that users only use LAMP stack?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/prashants/webzash/issues/150#issuecomment-901121254, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAQULAPEFO4IVTI4QMDWA3T5OZMZANCNFSM5B7W3UXA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .

jessicana commented 2 years ago

Thank you very much for your support!

The software is now installed and working. Thank you for making this happen and for the smooth installation process. The software itself is not complicated to use when it comes to maintaining simple accounting records. For those who wants to run this on Nginx LEMP stack in a subdirectory, please follow these steps:

  1. Install the latest version from: https://webzash.org/download.html
  2. create a subdirectory in your root directory/folder. In this example, I will call it: webzash and I can access it by visiting my domain: http://domain.com/webzash
  3. Upload the content to the webzash subdirectory, unzip and extract the content there. This means that the content of webzash download folder will be extracted inside the /webzash subdirectory.
  4. Permissions: Execute the below command to add permissions to webzash folder. Change the below as appropriate: sudo chown www-data:www-data -R /var/www/domain.com/html/root/webzash
  5. Edit your Nginx configuration file located in: /etc/nginx/sites-available. For example: sudo nano /etc/nginx/sites-available/domain.com and add:

    location ^~ /webzash {
    root /var/www/domain.com/html/root;
    index index.php;
    try_files $uri $uri/ /webzash/index.php;
    
    location ~ \.php$ {
    try_files $uri =404;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_pass unix:/run/php/php8.0-fpm.sock;
    }
    }

    Your configuration file will look like this:

##
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# https://www.nginx.com/resources/wiki/start/
# https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/
# https://wiki.debian.org/Nginx/DirectoryStructure
#
# In most cases, administrators will remove this file from sites-enabled/ and
# leave it as reference inside of sites-available where it will continue to be
# updated by the nginx packaging team.
#
# This file will automatically load configuration files provided by other
# applications, such as Drupal or Wordpress. These applications will be made
# available underneath a path with that package name, such as /drupal8.
#
# Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.
##

# Default server configuration
#
server {
    listen 80 ;
    listen [::]:80 ;

    # SSL configuration
    #
    # listen 443 ssl default_server;
    # listen [::]:443 ssl default_server;
    #
    # Note: You should disable gzip for SSL traffic.
    # See: https://bugs.debian.org/773332
    #
    # Read up on ssl_ciphers to ensure a secure configuration.
    # See: https://bugs.debian.org/765782
    #
    # Self signed certs generated by the ssl-cert package
    # Don't use them in a production server!
    #
    # include snippets/snakeoil.conf;

    root /var/www/domain.com/html/root;

    # Add index.php to the list if you are using PHP
    index index.php index.html index.htm index.nginx-debian.html;

    server_name domain.com www.domain.com;

    location / {
        # First attempt to serve request as file, then
        # as directory, then fall back to displaying a 404.
        try_files $uri $uri/ /index.php?$args; 
    }

    # pass PHP scripts to FastCGI server
    #
        location ~ \.php$ {
        include snippets/fastcgi-php.conf;
    #
    #   # With php-fpm (or other unix sockets):
        fastcgi_pass unix:/var/run/php/php8.0-fpm.sock;
    #   # With php-cgi (or other tcp sockets):
    #   fastcgi_pass 127.0.0.1:9000;
    }

    # deny access to .htaccess files, if Apache's document root
    # concurs with nginx's one
    #
    location ~ /\.ht {
        deny all;
    }

location ^~ /webzash {
    root /var/www/domain.com/html/root;
    index index.php;
    try_files $uri $uri/ /webzash/index.php;

    location ~ \.php$ {
    try_files $uri =404;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_pass unix:/run/php/php8.0-fpm.sock;
  }
}

} # the closing tag of your server opening tag

# Virtual Host configuration for example.com
#
# You can move that to a different file under sites-available/ and symlink that
# to sites-enabled/ to enable it.
#
#server {
#   listen 80;
#   listen [::]:80;
#
#   server_name example.com;
#
#   root /var/www/example.com;
#   index index.html;
#
#   location / {
#       try_files $uri $uri/ =404;
#   }
#}

Verify there are no errors: sudo nginx -t Restart Nginx sudo service nginx restart OR sudo systemctl restart nginx

  1. Visit: http://domain.com/webzash and you will be prompted to install the software. You will be asked about the following information: Database type: MYSQL Database name: DBnameDBname can be changed based on your created database name. Database host: localhost Database port: 3306 Database login: DBuser DBuser can be changed based on your created database user login. Database password: DBpassword DBpassword can be changed based on the password you have for your DBuser. Database table prefix: Keep empty.
  2. You will be prompted to create a user name, use admin admin for your first login.

I help this helps someone else install Webzash on LEMP stack.

prashants commented 2 years ago

Thanks for the guide. I have added a link to this guide from Wiki FAQ.