GrayNeel/Calendary-and-ToDo-List

Setting up apache to use sabre/dav

Closed this issue · 1 comments

In order to use sabre/dav 3.2.2 the PHP v7.3.31 is needed.

Go to the following path Apache24/conf/ and open the httpd.conf file.

  1. Uncomment the following line: LoadModule rewrite_module modules/mod_rewrite.so
  2. Add the following lines: AddHandler application/x-httpd-php .php AddType application/x-httpd-php .php .html LoadModule php_module "C:/your/path/to/php/php8apache2_4.dll" PHPIniDir "C:/your/path/to/php"
  3. Uncomment the following line: Include conf/extra/httpd-vhosts.conf

Then, go to the following path Apache24/conf/extra and open the httpd-vhosts.conf file and add the following VirtualHost:

<VirtualHost *:8080>
    ServerAdmin 127.0.0.1
    ServerName 127.0.0.1
    DocumentRoot "C:/path/to/the/project/server"
    <Directory "C:/path/to/the/project/server">
        #
        # Possible values for the Options directive are "None", "All",
        # or any combination of:
        #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
        #
        # Note that "MultiViews" must be named *explicitly* --- "Options All"
        # doesn't give it to you.
        #
        # The Options directive is both complicated and important.  Please see
        # http://httpd.apache.org/docs/2.4/mod/core.html#options
        # for more information.
        #
        Options Indexes FollowSymLinks

        #
        # AllowOverride controls what directives may be placed in .htaccess files.
        # It can be "All", "None", or any combination of the keywords:
        #   Options FileInfo AuthConfig Limit
        #
        AllowOverride None

        #
        # Controls who can get stuff from this server.
        #
        Require all granted
    </Directory>
    
    RewriteEngine On
    # This makes every request go to server.php
    RewriteRule ^/(.*)$ /server.php [L]
    # Output buffering needs to be off, to prevent high memory usage
    php_flag output_buffering off

    # This is also to prevent high memory usage
    php_flag always_populate_raw_post_data off

    # This is almost a given, but magic quotes is *still* on on some
    # linux distributions
    php_flag magic_quotes_gpc off

    # SabreDAV is not compatible with mbstring function overloading
    php_flag mbstring.func_overload off


    # ServerAlias www.dummy-host.example.com
    # ErrorLog "logs/dummy-host.example.com-error.log"
    # CustomLog "logs/dummy-host.example.com-access.log" common
</VirtualHost>

The php.ini-development file in the PHP folder has to be renamed as php.ini. Then, by opening the file the line extension=mbstring has to be uncommented.

To make SQLite work, go to php.ini file and uncomment extension=sqlite3 and extension=pdo_sqlite