Installing Invoiceplane in a subfolder - "404 Error"

I did a clean install of Invoiceplae 15.5.11 in a subfolder on my shared hosting server. I followed the instructions here

https://wiki.invoiceplane.com/en/1.5/getting-started/installation

I added the URL of my subfolder in ipconfig.php just as indicated.

When I run http://your-domain.com/index.php/setup I get to the “Choose language” step, but when I choose my language I cannot go on any further. I get a “404 Page not found” error and a red background.

I also changed the htaccess as indicated but this didn’t help as well.

Mod_rewrite seems to be enabled on the server by the way.

I enabled debug-mode and had a look at the log files.

DEBUG - 2020-04-19 17:06:54 --> UTF-8 Support Enabled
DEBUG - 2020-04-19 17:06:54 --> Global POST, GET and COOKIE data sanitized
ERROR - 2020-04-19 17:06:54 --> 404 Page Not Found: ../modules/setup/controllers/Setup/<mydomain.tld>
DEBUG - 2020-04-19 17:06:55 --> UTF-8 Support Enabled
DEBUG - 2020-04-19 17:06:55 --> Global POST, GET and COOKIE data sanitized
ERROR - 2020-04-19 17:06:55 --> 404 Page Not Found: ../modules/setup/controllers/Setup/<mydomain.tld>
DEBUG - 2020-04-19 17:06:57 --> UTF-8 Support Enabled
DEBUG - 2020-04-19 17:06:57 --> Global POST, GET and COOKIE data sanitized
ERROR - 2020-04-19 17:06:57 --> 404 Page Not Found: ../modules/setup/controllers/Setup/<mydomain.tld>

What can I do?

To be honest I never installed IP in a subdirectory.

  1. Pls Post your .htaccess (you can censor the the Domain)
  2. Also did your environment statisfy this REQIUREMENTS?
  3. Did you change the IP_URL in the ipconfig.php to https://domain.tld/subdirectory ?
  4. does the required use have all the rights he needs?
  5. What ServerOS are you running on?
  6. Which PHP version is getting used?
  1. See below
  2. Yes. I have PHP 7.3.15, MySQL 5.7.28 and all the other stuff
  3. Yes
  4. What rights does the user need?
  5. Debian, its Netcup.de
  6. PHP 7.3.15

.htaccess:

<IfModule mod_rewrite.c>

  RewriteEngine On
  RewriteBase /invoice
  RewriteRule ^index\.php$ - [L]
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule . /index.php [L]
  
  ## Remove the hash in front of the following two lines if you want to force HTTPS
  RewriteCond %{HTTPS} off
  RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
  
</IfModule>

We would need an error log to debug this, but let me test a subdirectory installation in the enxt days.

Thanks. The log is not very helpful:

ERROR - 2020-04-25 10:40:08 --> 404 Page Not Found: /index
DEBUG - 2020-04-25 10:40:46 --> UTF-8 Support Enabled
DEBUG - 2020-04-25 10:40:46 --> Global POST, GET and COOKIE data sanitized
ERROR - 2020-04-25 10:40:46 --> 404 Page Not Found: /index
DEBUG - 2020-04-25 10:40:48 --> UTF-8 Support Enabled
DEBUG - 2020-04-25 10:40:48 --> Global POST, GET and COOKIE data sanitized
ERROR - 2020-04-25 10:40:48 --> 404 Page Not Found: /index

Hm thats strange, it should not try to call “/index” but “index.php” but as already said I can not say for sure if the htaccess is still valid for subdirectorys but I will indeed test this the comming days.

Ok I tested it and indeed there is an issue with the provided standard htaccess.

Let me assume:

  1. you have enabled the “REMOVE_INDEXPHP” feature?
  2. you have installed IPv1 in a subdirectory? (ok this is obviously)

Could you tell me the exact subdirectory in which you installed InvoicePlane? Then I will provide you the corrected htaccess.

Thanks for your help!

  1. I don’t know, I can’t see it on the phpinfo-page, where should I enable it?
  2. The name of the subdirectory is “invoice”

That has nothing to do with phpinfo. But cyou can configurate it in IP_config.php

Then pls change the htaccess to:

##EDIT: pls see below

  1. Ah sorry, I forgot what “REMOVE_INDEXPHP" is, its enabled.

  2. Thanks for the .htaccess. Unfortunately I still get a 404 Page Not Found

When I try to start the installation by accessing the URL , <myurl>.de/invoice/index.php/setup

I get a 404 Page Not Found
and the URL changes to https://<myurl>.de/invoice/index.php/<myurl>.de/invoice/setup/language

Something is still wrong with the redirection, I guess

Please have a look at:

demo.invoiceplane.com/demo

The used htaccess is:

<IfModule mod_rewrite.c>
  RewriteEngine On

  ### uncomment to force HTTPS
  RewriteCond %{HTTPS} off
  RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]

  RewriteRule ^index\.php$ - [L]
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  ### uncomment and adjust if installed in subdirectory
  RewriteRule . /demo/index.php [L]
</IfModule>

You can PM me with your real Domain and I will try to help you.

So your htaccess should look like this:

<IfModule mod_rewrite.c>
  RewriteEngine On

  ### uncomment to force HTTPS
  RewriteCond %{HTTPS} off
  RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]

  RewriteRule ^index\.php$ - [L]
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  ### uncomment and adjust if installed in subdirectory
  RewriteRule . /invoice/index.php [L]
</IfModule>

May I recommend the docker-compose install instead? I use it as a subpath through Apache reverse proxy. It seems to work well.

Nop, still doesn’t work. I give up ut this point. I don’t really need Invoiceplane, was just looking for an alternative. Perhaps the next version will work better.

But I remember that I once tried an IP-version (1.4?) that worked fine in a subfolder…

I’m using a shared webspace for this, so no docker for me.

If you want, you can PM me temporary FTP credentials and I will help you. (dort können wir auch gerne auf deutsch schreiben)

Like I already wrote: the htaccess posted above is getting used at demo.invoiceplane.com/demo and works perfectly fine.

This version works perfectly fine, also in subdirectorys. See → demo.invoiceplane.com/demo

Hello,
I also have big difficulties each time I want to upgrade invoice plane (which works great apart this hectic upgrade for my use by the way).
I don’t understand why htaccess is without the initial point “.” in the model as is the case usually on apache servers. I need to remove it to make the app working.

I can’t make it works now without the index.php addition.
so need to keep REMOVE_INDEXPHP=false in the ipconfig.php file

I’ve tried locally and on a remote server, in or out of a subfolder ; with the same result : I can’t make it works anymore with the htaccess file to have nice URLs

Because if you change the htaccess (which you should to fit your needs) it would get overwritten by the standard htaccess if it would have a leading dot.
By removing the dot in the installation file you are save to overwrite the existing files with the files from the new update.

This actually makes it much more easy to update.
When updating you dont need to change the htaccess (unless the original one changes).
If the original provided by the update changes you should adapt the changes.

If you provide me (via PM) some temporary access to your server I can have a look at it