leandrowkz / acmeframework-php

ACME Framework is a CodeIgniter powerful small application with a lot of features ready-to-use like login, users, permissions, menus, a powerful API and more.
http://acmeframework.codecomplex.io
27 stars 9 forks source link

permission of acmeframework folder in web server. #24

Closed probastaller closed 8 years ago

probastaller commented 8 years ago

Hi, I'm trying to test acmeframework 3.0.0 but i only get permission errors on the web browser after placing the folder in /var/www/html in a local apache2 webserver in Linux Mint 17.2. I have installed php 5.5.9 and the php5-pgsql plugin. Followed the instruccions on the web and just extracted the downloaded framework folder and put it in /var/www/html (root permissions required). Is there something else i have to do to make it work?. Does it need any special set of permissions on that folder?. Thank you very much.

probastaller commented 8 years ago

Some extra info about the error:

( ! ) Warning: mkdir(): Permission denied in /var/www/html/acme/system/core/Log.php on line 122 Call Stack

Time Memory Function Location

1 0.0006 126952 {main}( ) ../index.php:0 2 0.0015 129528 require_once( '/var/www/html/acme/system/core/CodeIgniter.php' ) ../index.php:292 3 0.0041 139244 load_class( ) ../CodeIgniter.php:197 4 0.0046 142380 CI_Hooks->construct( ) ../Common.php:196 5 0.0046 142436 load_class( ) ../Hooks.php:90 6 0.0054 146844 CI_Config->construct( ) ../Common.php:196 7 0.0054 146984 log_message( ) ../Config.php:106 8 0.0054 147040 load_class( ) ../Common.php:475 9 0.0060 151060 CI_Log->__construct( ) ../Common.php:196 10 0.0060 151248 mkdir ( ) ../Log.php:122 11 0.0060 152140 _error_handler( ) ../Log.php:122 12 0.0069 159920 CI_Exceptions->log_exception( ) ../Common.php:622 13 0.0069 160076 log_message( ) ../Exceptions.php:105 14 0.0069 160132 load_class( ) ../Common.php:475 15 0.0069 160360 CI_Log->__construct( ) ../Common.php:196 16 0.0069 160548 mkdir ( ) ../Log.php:122

( ! ) Fatal error: Class 'CI_Controller' not found in /var/www/html/acme/system/core/CodeIgniter.php on line 366 Call Stack

Time Memory Function Location

1 0.0006 126952 {main}( ) ../index.php:0 2 0.0015 129528 require_once( '/var/www/html/acme/system/core/CodeIgniter.php' ) ../index.php:292 3 0.0041 139244 load_class( ) ../CodeIgniter.php:197 4 0.0046 142380 CI_Hooks->construct( ) ../Common.php:196 5 0.0046 142436 load_class( ) ../Hooks.php:90 6 0.0054 146844 CI_Config->construct( ) ../Common.php:196 7 0.0054 146984 log_message( ) ../Config.php:106 8 0.0054 147040 load_class( ) ../Common.php:475 9 0.0060 151060 CI_Log->__construct( ) ../Common.php:196 10 0.0060 151248 mkdir ( ) ../Log.php:122 11 0.0060 152140 _error_handler( ) ../Log.php:122 12 0.0072 160748 ACME_Exceptions->show_php_error( ) ../Common.php:627 13 0.0072 160764 get_instance( ) ../ACME_Exceptions.php:72

( ! ) Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/acme/system/core/Log.php:122) in /var/www/html/acme/system/core/Common.php on line 573 Call Stack

Time Memory Function Location

1 0.0006 126952 {main}( ) ../index.php:0 2 0.0015 129528 require_once( '/var/www/html/acme/system/core/CodeIgniter.php' ) ../index.php:292 3 0.0041 139244 load_class( ) ../CodeIgniter.php:197 4 0.0046 142380 CI_Hooks->construct( ) ../Common.php:196 5 0.0046 142436 load_class( ) ../Hooks.php:90 6 0.0054 146844 CI_Config->construct( ) ../Common.php:196 7 0.0054 146984 log_message( ) ../Config.php:106 8 0.0054 147040 load_class( ) ../Common.php:475 9 0.0060 151060 CI_Log->__construct( ) ../Common.php:196 10 0.0060 151248 mkdir ( ) ../Log.php:122 11 0.0060 152140 _error_handler( ) ../Log.php:122 12 0.0072 160748 ACME_Exceptions->show_php_error( ) ../Common.php:627 13 0.0072 160764 get_instance( ) ../ACME_Exceptions.php:72 14 0.0075 161000 _shutdown_handler( ) ../Common.php:0 15 0.0075 161532 _error_handler( ) ../Common.php:692 16 0.0075 161632 set_status_header( ) ../Common.php:611 17 0.0075 165072 header ( ) ../Common.php:573

( ! ) Fatal error: Class 'CI_Controller' not found in /var/www/html/acme/system/core/CodeIgniter.php on line 366 Call Stack

Time Memory Function Location

1 0.0006 126952 {main}( ) ../index.php:0 2 0.0015 129528 require_once( '/var/www/html/acme/system/core/CodeIgniter.php' ) ../index.php:292 3 0.0041 139244 load_class( ) ../CodeIgniter.php:197 4 0.0046 142380 CI_Hooks->construct( ) ../Common.php:196 5 0.0046 142436 load_class( ) ../Hooks.php:90 6 0.0054 146844 CI_Config->construct( ) ../Common.php:196 7 0.0054 146984 log_message( ) ../Config.php:106 8 0.0054 147040 load_class( ) ../Common.php:475 9 0.0060 151060 CI_Log->__construct( ) ../Common.php:196 10 0.0060 151248 mkdir ( ) ../Log.php:122 11 0.0060 152140 _error_handler( ) ../Log.php:122 12 0.0072 160748 ACME_Exceptions->show_php_error( ) ../Common.php:627 13 0.0072 160764 get_instance( ) ../ACME_Exceptions.php:72 14 0.0075 161000 _shutdown_handler( ) ../Common.php:0 15 0.0075 161532 _error_handler( ) ../Common.php:692 16 0.0078 161648 ACME_Exceptions->show_php_error( ) ../Common.php:627 17 0.0078 161648 get_instance( ) ../ACME_Exceptions.php:72

leandrowkz commented 8 years ago

Hi @probastaller, thanks for your reply.

Just create a folder called 'logs' inside application folder. Set write permissions to this folder as well.

probastaller commented 8 years ago

Hi @leandrowkz, Thank you very much for your anwer. I followed your instructions and I got a step forwards. Now I get this new error: " Warning: mkdir(): Permission denied in /var/www/html/acme/system/libraries/Session/drivers/Session_files_driver.php on line 117 ". I guess this is not a normal issue. Or is this happening in every acmeframework installation under GNU/Linux?.

leandrowkz commented 8 years ago

@probastaller, now you have to create a folder called 'sessions' inside application folder. We going to include this two folders on next release just to avoid this problems and make things easier for everyone using acme.

Thanks for your reply :)

probastaller commented 8 years ago

Well, we got rid of error messages. But now I just get a blank page with no info at all. Any ideas?. Sorry for the insistence. And thank you for the time you are taking on this. I really appreciate it.

leandrowkz commented 8 years ago

Check if your php is set to show errors. Also check any apache/php error log files. Try to set write permissions to all acme instance folder, including system and application folder.

probastaller commented 8 years ago

Does this help you find out the reason?:

[Mon Nov 16 19:16:06.486957 2015] [:error] [pid 16714] [client 127.0.0.1:44870] PHP Fatal error: Call to a member function userdata() on a non-object in /var/www/html/acme/application/views/bootflat/html-components/header-assets/header-assets.php on line 42 [Mon Nov 16 19:16:06.487004 2015] [:error] [pid 16714] [client 127.0.0.1:44870] PHP Stack trace: [Mon Nov 16 19:16:06.487017 2015] [:error] [pid 16714] [client 127.0.0.1:44870] PHP 1. _exception_handler() /var/www/html/acme/system/core/Common.php:0 [Mon Nov 16 19:16:06.487028 2015] [:error] [pid 16714] [client 127.0.0.1:44870] PHP 2. ACME_Exceptions->show_exception() /var/www/html/acme/system/core/Common.php:662 [Mon Nov 16 19:16:06.487038 2015] [:error] [pid 16714] [client 127.0.0.1:44870] PHP 3. Error->show_exception() /var/www/html/acme/application/core/ACME_Exceptions.php:58 [Mon Nov 16 19:16:06.487048 2015] [:error] [pid 16714] [client 127.0.0.1:44870] PHP 4. Template->load_view() /var/www/html/acme/application/libraries/Error.php:68 [Mon Nov 16 19:16:06.487057 2015] [:error] [pid 16714] [client 127.0.0.1:44870] PHP 5. CI_Loader->view() /var/www/html/acme/application/libraries/Template.php:44 [Mon Nov 16 19:16:06.487083 2015] [:error] [pid 16714] [client 127.0.0.1:44870] PHP 6. CI_Loader->_ci_load() /var/www/html/acme/system/core/Loader.php:459 [Mon Nov 16 19:16:06.487091 2015] [:error] [pid 16714] [client 127.0.0.1:44870] PHP 7. include() /var/www/html/acme/system/core/Loader.php:928 [Mon Nov 16 19:16:06.487098 2015] [:error] [pid 16714] [client 127.0.0.1:44870] PHP 8. Template->load_html_component() /var/www/html/acme/application/views/bootflat/errors/html/error-exception.php:5 [Mon Nov 16 19:16:06.487107 2015] [:error] [pid 16714] [client 127.0.0.1:44870] PHP 9. Template->load_view() /var/www/html/acme/application/libraries/Template.php:80 [Mon Nov 16 19:16:06.487118 2015] [:error] [pid 16714] [client 127.0.0.1:44870] PHP 10. CI_Loader->view() /var/www/html/acme/application/libraries/Template.php:44 [Mon Nov 16 19:16:06.487125 2015] [:error] [pid 16714] [client 127.0.0.1:44870] PHP 11. CI_Loader->_ci_load() /var/www/html/acme/system/core/Loader.php:459 [Mon Nov 16 19:16:06.487131 2015] [:error] [pid 16714] [client 127.0.0.1:44870] PHP 12. include() /var/www/html/acme/system/core/Loader.php:928

leandrowkz commented 8 years ago

You have to set write permissions in application/sessions folder.

probastaller commented 8 years ago

I gave full permission to folder 'log' and 'sessions'. And now i get a 404 error. Page not found. The requested URL /acme/app-installer/ was not found on this server. Apache/2.4.7 (Ubuntu) Server at localhost Port 80

leandrowkz commented 8 years ago

Have you enabled mod_rewrite in Apache ?

probastaller commented 8 years ago

Yes. $ a2enmod rewrite Module rewrite already enabled

leandrowkz commented 8 years ago

What is the full URL you're trying to access ?

probastaller commented 8 years ago

http://localhost/acme/ But after pressing return, it redirects me to http://localhost/acme/app-installer/ where it shows the error.

probastaller commented 8 years ago

Hi, I installed a new ubuntu 15.04 system in a virtual machine and did all the steps from the beginning. Even tried with older versions of the acme framework but with exactly the same result. So, could this be a problem in all linux servers?. Or is it just me that all the Gods decided that I should not use acme framework? :( .

This is the resumed step by step done in the virtual machine: sudo apt-get install apache2 php5 php5-pgsql postgresql sudo cp -rv Descargas/acme /var/www/html/ sudo a2enmod rewrite cd /var/www/html/acme/application/ sudo chmod -R 777 logs/ sessions/ sudo service apache2 restart

leandrowkz commented 8 years ago

@probastaller, i'm gonna duplicate those 2 environments here (ubuntu and mint) and see what is going on, ok? Hope i get an answer to you today :)

Thank you very much for your reply.

leandrowkz commented 8 years ago

@probastaller, try to access in your ubuntu environment URL http://localhost/acme/index.php/app-installer/system-requirements and tell me if installation step one is show :)

probastaller commented 8 years ago

Yeah!. But still with permission problems. Here you are the page I get printed as pdf: acme.pdf

leandrowkz commented 8 years ago

Hi @probastaller, i was be able to replicate same error here in a ubuntu 15.10 environment that i created. The issue is on your apache configuration, even when you enable mod_rewrite you have to allow override from .htaccess files.

So please edit your /etc/apache2/apache2.conf file and find:

<Directory /var/www/> Options Indexes FollowSymLinks AllowOverride None Require all granted

And change

AllowOverride None

to

AllowOverride All

Then after that restart your apache server. I'll be waiting your ok.

probastaller commented 8 years ago

Well.... I wish it was a BIG OK. I did those changes and the installation step one is accessible from http://localhost/acme/index.php/app-installer/system-requirements only. And if I select a PHP database driver from the radio buttons I automatically get a:

Not Found The requested URL /acme/app-installer/system-requirements was not found on this server. Apache/2.4.10 (Ubuntu) Server at localhost Port 80

Should I give full permissions to application/core and application/config ?. I'm sorry :(

leandrowkz commented 8 years ago

No, did you try to change AllowOverride None to AllowOverride All and restart apache2 server?

Then after that you can access without index.php portion on the URL.

probastaller commented 8 years ago

Sorry! I made a mistake! There was two sections in apache2.conf with the options you mentioned: <Directory /var/www/> Options Indexes FollowSymLinks AllowOverride All Require all granted

<Directory /srv/>

Options Indexes FollowSymLinks

AllowOverride All

Require all granted

I only did it for Directory /srv/. I changed it now on Directory /var/www as well and it works!.
I still get permission problems with core and config folders as well as the error on the downside of the page I sent in pdf.

Please excuse me for my mistake :)

leandrowkz commented 8 years ago

Well, this kind of permission problem you can solve, just set right permissions to entire project folder.

probastaller commented 8 years ago

Ok. thank you very much for you time and effort. It was really kind of your part. I'll make my best to make it work. It would be great to add this instructions to the installation manual for future users. Thanks a lot again @leandrowkz :)

leandrowkz commented 8 years ago

You're welcome, @probastaller. I really appreciated your feedback :)