"Sorry, this installer requires PHP!" error but I have PHP

Started by jeffythedragonslayer, March 10, 2023, 03:08:19 AM

Previous topic - Next topic

jeffythedragonslayer

I have SMF extracted to C:\smf\ on a Windows Server 2019.  When I point firefox to install.php, I get the dreaded "Sorry, this installer requires PHP!" error.  Notwithstanding:

PS C:\php> .\php.exe -v
PHP 8.2.3 (cli) (built: Feb 14 2023 09:55:52) (ZTS Visual C++ 2019 x64)
Copyright (c) The PHP Group
Zend Engine v4.2.3, Copyright (c) Zend Technologies

Does anyone know what is setup wrong?  Thanks.

Aleksi "Lex" Kilpinen

Try with a phpinfo, if that doesn't work either it's clear that your php or webserver isn't configured properly to handle .php files. What is a phpinfo() file?

EDIT: Also, I am unsure of PHP 8.2 compatibility at this point. I wouldn't aim that high myself. 8.1 should be fine.
Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

jeffythedragonslayer

I can try phpinfo later, but I know PHP works because I have a phpbb board running on this same server.

Sesquipedalian

Quote from: Aleksi "Lex" Kilpinen on March 10, 2023, 03:10:14 AMEDIT: Also, I am unsure of PHP 8.2 compatibility at this point. I wouldn't aim that high myself. 8.1 should be fine.

SMF 2.1 is fine on PHP 8.2.
I promise you nothing.

Sesqu... Sesqui... what?
Sesquipedalian, the best word in the English language.

Sesquipedalian

Quote from: jeffythedragonslayer on March 10, 2023, 03:20:37 AMI can try phpinfo later, but I know PHP works because I have a phpbb board running on this same server.

Then there seems to be something odd going on with your server's configuration.

Perhaps you have different virtual hosts on your server using different configurations. Perhaps there are local .htaccess files overriding the default configuration (or web.config files if you are using IIS instead of Apache).

One way or another, though, your server is not using PHP to run SMF's install.php file. Instead, your server is just reading the file as if it were a plain HTML file rather than a PHP file.
I promise you nothing.

Sesqu... Sesqui... what?
Sesquipedalian, the best word in the English language.

jeffythedragonslayer

Firefox shows a blank page when I point it to phpinfo.php  :-[

I'm running this on the bare metal btw - no virtual hosts.

I also ordered a PHP book so I can figure out what I'm doing.

Arantor

I see you have installed PHP, that's not enough - PHP doesn't listen on ports 80 or 443, doesn't deal with SSL; these are things Apache, nginx, IIS etc. deal with and they pass it to PHP to do the work when they're suitably configured to do.

What's going on is that something knows to listen on these ports, and pass the request to the appropriate files - installing SMF in a random folder (and possibly PHP in a random folder) won't work here.

So the question is, what's listening on ports 80 and 443 and responding to requests for phpBB? Because that's what we'll need to reconfigure to also support installing SMF alongside it.

Honestly, though, doing this on a bare metal Windows, especially if you're not already fairly conversant with what must come next... it's pretty hard work, and one reason we never encourage people to run their own servers unless they're willing to do a *lot* of learning, which we're not really in a position to do the teaching for.
Holder of controversial views, all of which my own.


jeffythedragonslayer

Hi Arantor,

Apache for phpbb is listening on ports 4433 and 8080.

Arantor

OK, so there's two key things going on here with that.

First, it's going to already have a binding for PHP in it (somewhere in its config, it'll have a type handler defined for PHP), you should be able to reuse that from phpBB for SMF.

Second, it's almost certainly going to define a virtual host. If it's not defining a virtual host, it's fundamentally misconfigured and will need actual reconfiguring. In this case, you'll have a definition somewhere that maps from the domain that phpBB is living on, to an actual folder. I would expect it to be defined with a <VirtualHost> directive somewhere that says what it's listening on and in there I'd expect a ServerName directive that matches the one you have for phpBB.

Setting up the bridge from Apache at this point should be no more than adding another <VirtualHost> directive matching the phpBB one, but changing the ServerName and DocumentRoot directives, respectively to the SMF domain name and the path to where SMF is going to live on the file system (which I think you have as C:/smf/ - you should use forward slashes in this path because \ has a special meaning in Apache)

You'll almost certainly need a <Directory> directive as well that sets up the rules for C:/smf/ to allow it to be visible (Require all granted) and if you want to use Pretty URLs down the line, you'll want to also enable .htaccess files (AllowOverride all)
Holder of controversial views, all of which my own.


jeffythedragonslayer

Thanks.  Right now, my config files are like this:

httpd.conf and httpd-xampp.conf have no VirtualHost tags at all.

httpd-ssl.conf has: <VirtualHost _default:4433>
httpd.conf has: ServerName localhost:8080
httpd-ssl.conf has: ServerName www.example.com:4433
I can't wait to dive deep into that PHP textbook and really learn this stuff.

Arantor

Wait. So you have this server, it has phpBB on it. It... is on the internet, right? Actual people not you can get to it?
Holder of controversial views, all of which my own.


jeffythedragonslayer

Quote from: Arantor on March 11, 2023, 06:02:00 PMWait. So you have this server, it has phpBB on it. It... is on the internet, right? Actual people not you can get to it?

Yep 8)

https://tinyurl.com/sneshomebrewforum

Arantor

Does it have an actual domain name? Using port 8080 like that isn't normal, you normally only do that on sites that are proxying from something else, port 4433 doesn't do anything (let alone anything SSL, though 443 is the proper SSL port). Proper vhost use is based around using actual domains rather than IP addresses.

Meanwhile you have the phpBB3 in a folder called phpBB3, there's nothing stopping you moving the SMF files into a folder that sits next to the phpBB3, called SMF/ and just install it from there. That raises the question of getting MySQL details and adding a new database for SMF but that's another problem for later.
Holder of controversial views, all of which my own.



jeffythedragonslayer

#14
Ok, I have moved my smf directory adjacent to the phpBB3 dir - that alone didn't help the browser actually run the install script.

EDIT: Also, there is both a web.config and a .htaccess at C:\xampp\htdocs\phpBB3\

Aleksi "Lex" Kilpinen

Usually, that should have worked.
Since the folder name is in the address, then you should be able to add basically anything you want in their own folders like this
/
/phpBB3/
/SMF21/
/Wordpress/
And everything should be working with the same default settings.

If they are not, then you have probably something specifically configured for the phpBB3 folder somewhere, that needs to be done for smf as well.

But truthfully, this is quite clearly no longer an SMF support issue.
Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

jeffythedragonslayer

It seems the LoadModule directive for php in httpd.conf has disappeared.  When I added it back in like so,

LoadModule php8_module "C:/php/php8apache2_4.dll"
Apache fails to start up.

Arantor

And what's in the error log?

Honestly: this is why we don't encourage people to run their own servers.
Holder of controversial views, all of which my own.


jeffythedragonslayer

I understand; I appreciate the help.  PFA error.log

Doug Heffernan

Quote from: jeffythedragonslayer on March 13, 2023, 06:04:39 PMI understand; I appreciate the help.  PFA error.log

The error mentioned in the log:

Quoteserver certificate does NOT include an ID which matches the server name

It happens due to server name on certificate does not matches with the server name defined in the webserver configuration.

The solution for this is to change the server name to localhost in your webserver configuration.

Advertisement: