Page: 1, 2  Next

Turning .htaccess support ON
ckosloff
Status: Contributor
Joined: 21 Dec 2011
Posts: 292
Location: South Florida
Reply Quote
Hi techadmin,
I am getting warning from Zencart installer about .htaccess support OFF.
I have gone through php.ini and there are no parameters for turning it ON, so probably I will have to load some apache module.
The server is the latest Debian build of Apache, I am on Wheezy.
PHP Version 5.4.0-3
Apache Version Apache/2.2.22 (Debian)
How can I turn .htaccess support ON, please?
Back to top
techAdmin
Status: Site Admin
Joined: 26 Sep 2003
Posts: 4127
Location: East Coast, West Coast? I know it's one of them.
Reply Quote
first, let me offer you my sincere condolences for having reached a point where using zencart seems like a good idea.

For local testing, I never use htaccess, I use apache config.

htaccess is only for remote servers in general, where you do not have access to the actual apache config files.

I have never had any issue with turning htaccess ON, in fact, I turn it OFF on my dev server.

:: Code ::
#
# AccessFileName: The name of the file to look for in each directory
# for additional configuration directives.  See also the AllowOverride
# directive.
#

AccessFileName .htaccess

#
# The following lines prevent .htaccess and .htpasswd files from being
# viewed by Web clients.
#
<Files ~ "^\.ht">
    Order allow,deny
    Deny from all
</Files>


that's apache2.conf

and:

:: Code ::
## smxi.org ##
<VirtualHost 127.0.0.1:80>
   ServerName smxi
   ServerAdmin webmaster@dummy-host.example.com
   DocumentRoot "/var/www/smxi"
   <Directory "/var/www/smxi">
      AllowOverride None
   </Directory>
   php_value include_path ".:/var/www/includes"
   DirectoryIndex index.htm index.html
</VirtualHost>


that's a simplified site n my local sites available section.

Please note that there are subtle differences between the syntax for apache config files and htaccess files.

The reason to do it this way? Obvious, paths on the remote server will not be the same as the local one.
Back to top
ckosloff
Status: Contributor
Joined: 21 Dec 2011
Posts: 292
Location: South Florida
Reply Quote
:: techAdmin wrote ::
first, let me offer you my sincere condolences for having reached a point where using zencart seems like a good idea.

Ha, ha, condolences accepted, but the fact is that I think that using Zencart is a terrible idea.
I am migrating that site and need to replicate it in my local server, so far it is not going through, I am getting blank page (fatal error) and trying to find out why.
Will be back on this later.
Thanks for help and rest assured that my next destination is Drupal Commerce.
Back to top
techAdmin
Status: Site Admin
Joined: 26 Sep 2003
Posts: 4127
Location: East Coast, West Coast? I know it's one of them.
Reply Quote
have you updated the primary zen cart config files, that have all the paths on them?

When I worked with that garbage, I set the configs to detect what system they were running on, and then used either the remote or local paths for the configs. That helped avoid using the wrong config file, ie, I had only one, with both sets of config data on it.
Back to top
ckosloff
Status: Contributor
Joined: 21 Dec 2011
Posts: 292
Location: South Florida
Reply Quote
Thanks for quick answers, I appreciate your help very much.
Regarding config files, I am aware of those, gone through them thoroughly and there are no mistakes there.
I have done this many times in the past.
There is a PHP fatal error going on, I will show it later.
Let's forget Zen Cart for the moment, I think that the problem is in my local server config because I set these parameters in my php.ini:
:: Code ::

; Common Values:
;   E_ALL & ~E_NOTICE  (Show all errors, except for notices and coding standards warnings.)
;   E_ALL & ~E_NOTICE | E_STRICT  (Show all errors, except for notices)
;   E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR  (Show only errors)
;   E_ALL | E_STRICT  (Show all errors, warnings and notices including coding standards.)
; Default Value: E_ALL & ~E_NOTICE
; Development Value: E_ALL | E_STRICT
; Production Value: E_ALL & ~E_DEPRECATED
; http://php.net/error-reporting
error_reporting = E_ALL | E_STRICT

; This directive controls whether or not and where PHP will output errors,
; notices and warnings too. Error output is very useful during development, but
; it could be very dangerous in production environments. Depending on the code
; which is triggering the error, sensitive information could potentially leak
; out of your application such as database usernames and passwords or worse.
; It's recommended that errors be logged on production servers rather than
; having the errors sent to STDOUT.
; Possible Values:
;   Off = Do not display any errors
;   stderr = Display errors to STDERR (affects only CGI/CLI binaries!)
;   On or stdout = Display errors to STDOUT
; Default Value: On
; Development Value: On
; Production Value: Off
; http://php.net/display-errors
display_errors = On

; The display of errors which occur during PHP's startup sequence are handled
; separately from display_errors. PHP's default behavior is to suppress those
; errors from clients. Turning the display of startup errors on can be useful in
; debugging configuration problems. But, it's strongly recommended that you
; leave this setting off on production servers.
; Default Value: Off
; Development Value: On
; Production Value: Off
; http://php.net/display-startup-errors
display_startup_errors = On

; Besides displaying errors, PHP can also log errors to locations such as a
; server-specific log, STDERR, or a location specified by the error_log
; directive found below. While errors should not be displayed on productions
; servers they should still be monitored and logging is a great way to do that.
; Default Value: Off
; Development Value: On
; Production Value: On
; http://php.net/log-errors
log_errors = On


However, nothing is showing in browser to give me a clue, I just get blank page.
I can find error in another way and will post shortly on it.
For the moment I just would like to know why my error reporting is not working, maybe a perms issue?
Please note that this website is online and working, I have replicated it locally in the past but now the local copy won't start.
Back to top
ckosloff
Status: Contributor
Joined: 21 Dec 2011
Posts: 292
Location: South Florida
Reply Quote
:: Code ::

[Wed Apr 04 11:56:53 2012] [error] [client 127.0.0.1] PHP Fatal error:  require(): Failed opening required 'includes/templates/template_default/templates/tpl_message_stack_default.php' (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/ladywig/includes/classes/message_stack.php on line 86

This is the fatal error, and I think that it is caused because the include path is not right.
So, where and how can I set the include path?
I got this from the apache2 error log.
Back to top
techAdmin
Status: Site Admin
Joined: 26 Sep 2003
Posts: 4127
Location: East Coast, West Coast? I know it's one of them.
Reply Quote
include path of course must be set. that is the very first thing I always do when setting up a new local site. And remote. NEVER use hard coded full include paths in your code except in that one single include path setting, which is of course also why I always use the apache config files for local, and htaccess for remote, the paths aren't the same.

The code sample posted shows an example of setting the include path in a sites_available file.
Back to top
ckosloff
Status: Contributor
Joined: 21 Dec 2011
Posts: 292
Location: South Florida
Reply Quote
Hm, I never did anything in sites available section, and I just installed a vanilla version of Zencart, which installed fine, so I am thinking that there must be some coding error in the old site that a newer version of PHP is detecting.
I also have a working version of Word Press (I know you don't like it), and have installed Drupal.
Anyway, I don't really care much about that website because I will have to rewrite it from scratch anyway, so the really critical issue for me is to get the local server configured right.
Looking in the sites available section I only see default and default.ssl, the latter because I created an SSL cert for my local server, following instructions from Debian docs.
This is my default (plain text document)
:: Code ::

<VirtualHost *:80>
   ServerAdmin webmaster@localhost

   DocumentRoot /var/www
   <Directory />
      Options FollowSymLinks
      AllowOverride None
   </Directory>
   <Directory /var/www/>
      Options Indexes FollowSymLinks MultiViews
      AllowOverride None
      Order allow,deny
      allow from all
   </Directory>

   ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
   <Directory "/usr/lib/cgi-bin">
      AllowOverride None
      Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
      Order allow,deny
      Allow from all
   </Directory>

   ErrorLog ${APACHE_LOG_DIR}/error.log

   # Possible values include: debug, info, notice, warn, error, crit,
   # alert, emerg.
   LogLevel warn

   CustomLog ${APACHE_LOG_DIR}/access.log combined

    Alias /doc/ "/usr/share/doc/"
    <Directory "/usr/share/doc/">
        Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from 127.0.0.0/255.0.0.0 ::1/128
    </Directory>

</VirtualHost>

Suppose that my folder/site name is ckosloff, what would I need to do?
Create a clone of default and name it ckosloff, adjusting paths accordingly?
I plan on tackling the error reporting not showing issue later on.
Back to top
techAdmin
Status: Site Admin
Joined: 26 Sep 2003
Posts: 4127
Location: East Coast, West Coast? I know it's one of them.
Reply Quote
When you start working with apache, you have to start at the beginning.

I've already posted a real sample site, and a bit of reading will show you how to make a link in sites _enabled.

It's very unwise to skip the beginning when working with apache and local sites, since nothing you work with remotely will have skipped that part.

There should be examples in the apache forums of much of this stuff.

Once you form good habits when creating a new local dev site, most issues will vaporize, and good habits are: create a real local site, enable it, learn how to use /etc/hosts to direct a local url, like: site1 to the appropriate site config, test / verify you have done this by creating a index page for that directory. Do not skip this step, it's the first one. That requires that apache is listening on port 80.

Do not use the default apache2 home page you see when you have not set up anything, leave that one alone, that's just a good place to test apache is running. Always create site directories, and set all parameters in there.

localhost should show the default apache home page
yoursite1 should show local yoursite1 once you have set the configs and added it to /etc/hosts.

Next is to enable php in that directory, and in apache, that can be done globally or in the sub dir of the site available.

Then verify that by creating a hello world php page.

Then set up an includes directory, and set the php include path in that sub dir for that site, then create an include, and create a php page that includes it. Load that page and verify it works.

Once you have done this, most issues are resolved.

Also of course make sure mysql is running with apache2 as expected.

There is zero point in even touching any advanced issue like getting zen cart running until you have all this completed and basically second nature, none. Only once you have completed all these tests can you ask the questions you are asking, otherwise you're just skipping stuff and then having issues, or having wild random luck if it works by chance, or by some hack.
Back to top
ckosloff
Status: Contributor
Joined: 21 Dec 2011
Posts: 292
Location: South Florida
Reply Quote
Thanks for answer.
Understood, back to the basics.
I guess I am too much in a hurry to get stuff going.
I have been googling to find a step-by-step tut on all the things you mention but, alas!, not that easy.
apache forums is full of spam, apache docs has outdated info not fit for latest debian version of apache2, etc.
I will try to wade all this, but probably will have lots of questions to ask as I go, so please bear with me.
If you know a good place to go to read on all this please post it here,
that will probably reduce the number of questions.
EDIT: /usr/share/doc/apache2-doc/manual/en/index.html
Will read this first.
Back to top
Display posts from previous:   
Page: 1, 2  Next
All times are GMT - 8 Hours