multiPHP version w Vhost - directive PHPINIDir not working

Problems with the Linux version of XAMPP, questions, comments, and anything related.

Re: multiPHP version w Vhost - directive PHPINIDir not worki

Postby Nobbie » 06. June 2019 15:16

Code: Select all
<VirtualHost *:80>
   DocumentRoot "/var/www/html2"
   ScriptAlias /local-bin /usr/bin
   AddHandler application/x-httpd-php php .php
   Action application/x-httpd-php /usr/bin/php-cgi7.2

<Directory "/usr/bin">
    Require all granted
</Directory>


    ErrorLog ${APACHE_LOG_DIR}/error80.log
        CustomLog ${APACHE_LOG_DIR}/access80.log combined

php_value session.save_path "/tmp"
php_value session.post_max_size "60M"
php_value session.upload_max_filesize "60M"
</VirtualHost>


That is an invalid VirtualHost, you are missing a ServerName directive and stll, your Action clause is wrong (but its not executed anyway, as this VirtualHost does not have a ServerName, therefore Apache cannot decide when to choose it).

Forget about the ports, use Port 80 always, VirtualHosts do not work as you expect, please provide proper ServerName instead and copy my VirtualHost declaration. I cannot help you if you are messing aroung instead of taking my advice. Its on you, of course i immediately can stop here and let you alone. Both your VirtualHosts dont work. They are also lacking the Directory clause including "Require all granted" for the DocumentRoot.

You also should find the configuration for the PHP Module 5.6 and comment it out, do not use Module and CGI both.
Nobbie
 
Posts: 13182
Joined: 09. March 2008 13:04

Re: multiPHP version w Vhost - directive PHPINIDir not worki

Postby smalldragoon » 07. June 2019 17:06

Hi,
Ok I made some DNS changes and switched back everything on port 80
No changes in apache.conf
I added "require all granted" for each directory

Virtual host udpdated :
Code: Select all
       ServerAdmin bob@free.fr
       DocumentRoot "/var/www/html2"
       ServerName joomla.mydomain.com

       ScriptAlias /local-bin /usr/bin
       AddHandler application/x-httpd-php php .php
       Action application/x-httpd-php /usr/bin/php-cgi7.2
    <Directory "/usr/bin">
        Require all granted
    </Directory>
    <Directory "/var/www/html2">
        Options Indexes FollowSymLinks ExecCGI Includes
        AllowOverride All
        Require all granted
    </Directory>
   
      ErrorLog ${APACHE_LOG_DIR}/errorjoomla.log
        CustomLog ${APACHE_LOG_DIR}/accessjoomla.log combined

Second Vhost
Code: Select all
       ServerAdmin webmaster@localhost
        DocumentRoot /var/www/html
       ServerName freepbx.mydomain.com
       ScriptAlias /local-bin /usr/bin
       AddHandler application/x-httpd-php php .php
       Action application/x-httpd-php /usr/bin/php-cgi5.6
    <Directory "/usr/bin">
        Require all granted
    </Directory>
    <Directory "/var/www/html">
        Options Indexes FollowSymLinks ExecCGI Includes
        AllowOverride All
        Require all granted
    </Directory>
        ErrorLog ${APACHE_LOG_DIR}/freepbx-error.log
        CustomLog ${APACHE_LOG_DIR}/freepbx-access.log combined


URL I try
http://freepbx.mydomain.com/info.php ( for 5.6 ) -> ok
and
http://joomla.mydomain.com/info.php ( for 7.2 ) -> no ok , returns 5.6

What am I missing now ?
Thanks
smalldragoon
 
Posts: 18
Joined: 29. May 2019 23:47
XAMPP version: 1.0
Operating System: ubuntu

Re: multiPHP version w Vhost - directive PHPINIDir not worki

Postby Nobbie » 07. June 2019 19:11

smalldragoon wrote:What am I missing now ?


Still wrong Action. In both VirtualHosts. You also should read the error_log, probably none your VirtualHosts are recognized. You still have PHP Moduled running, that collides with CGI. As you (again) do not show fuil configuration, i have no clue whats wrong. Actually, i am pretty sure that your VirtualHosts declarations arent recognized (as already said). Dont know why (maybe missing include or so), but for me it looks so. You would get 403/404 Errors in case of recognized VirtualHosts.

Therefore: Sorry - but this is now my last posting on that, i give up. Good luck.
Nobbie
 
Posts: 13182
Joined: 09. March 2008 13:04

Re: multiPHP version w Vhost - directive PHPINIDir not worki

Postby smalldragoon » 07. June 2019 20:59

Hi Ronnie.
I mentionned that I did not changed the apache.conf and posted the 2 vhost files content. I think you have my all config ( apache.conf from the previous - previous post and module with changes now ). If there is somehting missing let me know
I obviously do not understand what you are saying that my action is not good. I posted you all path of the php version. what should I put then as action ? not the php exec file ( cgi one ? )
When you say : php moduled running : I disabled php5.6 with "A2dismod php5.6". should I do something else ?
I'm sorry if my english is not good
smalldragoon
 
Posts: 18
Joined: 29. May 2019 23:47
XAMPP version: 1.0
Operating System: ubuntu

Re: multiPHP version w Vhost - directive PHPINIDir not worki

Postby Nobbie » 07. June 2019 21:29

If your English is bad, no problem, there are sites like deepl.com. I'm using deepl.com now because it's easy.

You say you haven't changed apache.conf. That doesn't tell me anything, you obviously mistakenly believe that I know your installation. Here is the XAMPP forum and actually I only help XAMPP installations, but I tried to help other installations as well. But I don't have the slightest idea what you have installed and how it works.

But I know that the VirtualHosts don't work, not one of them here. I don't know why not, you have to figure that out for yourself.

All in all, however, I think that your project and your wishes exceed your knowledge far too much. I don't know why you want to realize something so demanding, but I know that you won't be able to do it. That is too much for your knowledge, which is unfortunately very very small. Why do you have to do it like this, I suggested you do two installations in two VirtualBox and I'm still convinced it's a good solution. Why isn't that enough for you? What is your problem?

The fact is that I can't help you anymore, I've given so many hints and you keep ignoring things, it's just too exhausting for me. I have such an environment, but I am also a highly qualified professional and I know what I have to do. But it's too exhausting to explain it to you, you do so much wrong that it's just annoying.

Why do you have to do something that a professional administrator normally has to do?

Translated with www.DeepL.com/Translator
Nobbie
 
Posts: 13182
Joined: 09. March 2008 13:04

Re: multiPHP version w Vhost - directive PHPINIDir not worki

Postby smalldragoon » 07. June 2019 21:40

Ok, I understand.
My config is one server only. I can not run 2 or virtual machines. the 2nd requirement is that I need to have 2 version of PHP running at the same time ( so 5.6 and 7.2 )
The machine is a ubuntu 18.04.
Initial config was a apache , running php 5.6 for a Freepbx application ( which is working no issues )
Now , we need to add a Joomla. The joomla requires PHP 7.2 version. This is the explanation of the "why"
I have 2 root directories
the one existings : /var/www/html where the freepbx files are
I created a new one to put joomla files : /var/www/html2
My initial post was regarding the php.ini which was not taken into account with FCM configuration ( I followed a tutorial ) and it was working. I was not just able to define the post_max_size of the files
Then you explained it was not ok and suggested your CGI config .
This is all the why
on top of this, you have my bad enbglish in explanation and understand
smalldragoon
 
Posts: 18
Joined: 29. May 2019 23:47
XAMPP version: 1.0
Operating System: ubuntu

Re: multiPHP version w Vhost - directive PHPINIDir not worki

Postby Nobbie » 07. June 2019 23:03

smalldragoon wrote:This is all the why


No it is not.

Why do YOU(!) need that? This forum is for private people only, that cannot afford professional help. It is NOT meant for companies to give free support. So still, why do YOU need this configuration? At home?? Why cant you simply install two VirtualBoxes on your PC?
Nobbie
 
Posts: 13182
Joined: 09. March 2008 13:04

Re: multiPHP version w Vhost - directive PHPINIDir not worki

Postby smalldragoon » 11. June 2019 15:23

ok understood.
we are not a company, we are a scuba see association. And we can only have 1 computer . We don't have enough knwoledge to resintall and configure freepbx.
it was your question ?
smalldragoon
 
Posts: 18
Joined: 29. May 2019 23:47
XAMPP version: 1.0
Operating System: ubuntu

Re: multiPHP version w Vhost - directive PHPINIDir not worki

Postby smalldragoon » 11. June 2019 16:52

I think I found the problem
There was a script from freepbx monitoring the apache server.
each time I was stopping it and restart, the script was stoping and replacing with a config specific to freepbx.
Now, when I stop apache, it is stopped.
I confirm what you were saying : Vhosts are not working.
When I enter in browser : joomla.mydomain.com
I have the following error :
-------
Code: Select all
Not Found

The requested URL /local-bin/php-cgi/index.php was not found on this server.


------
smalldragoon
 
Posts: 18
Joined: 29. May 2019 23:47
XAMPP version: 1.0
Operating System: ubuntu

[Solved]l multiPHP version w Vhost - directive PHPINIDir not

Postby smalldragoon » 12. June 2019 23:34

Hi all, for community knowledge. Forget about all explanations before and switch back FPM config

install appropriate modules :

Code: Select all
sudo apt install apache2 libapache2-mod-fcgid

install php and php-fpm versions versions

Code: Select all
sudo apt install php5.6 php5.6-fpm
sudo apt install php7.2 php7.2-fpm


Enable modules
Code: Select all
sudo a2enmod actions fcgid alias proxy_fcgi


Configure the php version appropriate for your module ( an exemple for the 5.6 here, of course, replace php5.6-fpm.sock with php7.2-fpm.sock if you want 7.2 ) :

<VirtualHost *:80>
ServerName freepbx.mydomain.com
DocumentRoot /var/www/html
<Directory /var/www/html>
Options -Indexes +FollowSymLinks +MultiViews
AllowOverride All
Require all granted
</Directory>
<FilesMatch \.php$>

SetHandler "proxy:unix:/var/run/php/php5.6-fpm.sock|fcgi://localhost/"
</FilesMatch>
</VirtualHost>


You can run it on port 80, 81, 58 ... no issues, and create multiple Vhost on multiple ports with any version of php ( in my case 5.6 or 7.2 )
You can change the php.ini for each php version and they are taken into account... no issues...
smalldragoon
 
Posts: 18
Joined: 29. May 2019 23:47
XAMPP version: 1.0
Operating System: ubuntu

Previous

Return to XAMPP for Linux

Who is online

Users browsing this forum: No registered users and 58 guests

cron