XF 2.1 Ubuntu 1.8 VPS install

kray

Member
So I tried uploading Xenforo to my VPS on my domain, but it kept handing me a file with this message included:

Code:
<?php

$phpVersion = phpversion();
if (version_compare($phpVersion, '5.6.0', '<'))
{
    die("PHP 5.6.0 or newer is required. $phpVersion does not meet this requirement. Please ask your host to upgrade PHP.");
}

$dir = __DIR__;
require($dir . '/src/XF.php');

XF::start($dir);

if (\XF::requestUrlMatchesApi())
{
    \XF::runApp('XF\Api\App');
}
else
{
    \XF::runApp('XF\Pub\App');
}

I have installed Apache, PHP, MySQL, NGINX. What's the problem?

I've got the newest version of PHP

PHP 7.2.15-0ubuntu0.18.04.1 (cli) (built: Feb 8 2019 14:54:22) ( NTS )
 
Why'd you install both Nginx and Apache? Can scrap Apache and connect Nginx directly to PHP-FPM.

Either way, you're getting that because the web server you have enabled isn't setup to use PHP so it's just serving the contents of the file
 
Why'd you install both Nginx and Apache? Can scrap Apache and connect Nginx directly to PHP-FPM.

Either way, you're getting that because the web server you have enabled isn't setup to use PHP so it's just serving the contents of the file

This is what I've got:

Code:
server {

        listen 80;

        root /var/www/bil.sh-rp.com;

        index index.php index.html index.htm index.nginx-debian.html;

        server_name www.bil.sh-rp.com;



        location / {

                try_files $uri $uri/ =404;

        }



        location ~ \.php$ {

                include snippets/fastcgi-php.conf;

                fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;

        }



        location ~ /\.ht {

                deny all;

        }

}

Still the same. I got rid of Apache, and I connected nginx to php-fpm (I think)
 
Last edited:
Create a file on the XF directory named test.php

Code:
<?php phpinfo();

Then view that file: www.youdomain.com/test.php

It will show you which php version is actually running. You can have multiple versions of PHP on a server, but need to make sure php-fpm is running the correct version. It sounds like it's not.
 
I managed to fix it, but there's a non xenforo issue that I would appreciate if you guys could help me out with.

My main domain keeps redirecting me to my subdomain (xenforo forums), and idk what's causing it. i've checked everything
 
Top Bottom