Jump to content

Shohreh

New Members
  • Posts

    9
  • Joined

  • Last visited

Shohreh's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thanks for the infos. I found how to install two version of PHP-FPM, and configure nginx to use a given version for a given directory.
  2. The joys of migrating… which explains why no one wants to do it and we end up with totally outdated and unsecure old servers. 5.6 should be fine to try migrating. A couple more questions: 1. Why does the php5.6 package contain no binaries? ~# apt-get download php5.6 ~# dpkg -c php5.6_5.6.40-63+0~20220929.69+debian11~1.gbp639d4c_all.deb drwxr-xr-x root/root 0 2022-09-30 00:13 ./usr/ drwxr-xr-x root/root 0 2022-09-30 00:13 ./usr/share/ drwxr-xr-x root/root 0 2022-09-30 00:13 ./usr/share/bug/ drwxr-xr-x root/root 0 2022-09-30 00:13 ./usr/share/bug/php5.6/ -rw-r--r-- root/root 25 2022-09-30 00:13 ./usr/share/bug/php5.6/control drwxr-xr-x root/root 0 2022-09-30 00:13 ./usr/share/doc/ drwxr-xr-x root/root 0 2022-09-30 00:13 ./usr/share/doc/php5.6/ -rw-r--r-- root/root 480 2022-09-18 14:52 ./usr/share/doc/php5.6/NEWS.Debian.gz -rw-r--r-- root/root 82584 2022-09-30 00:13 ./usr/share/doc/php5.6/changelog.Debian.gz -rw-r--r-- root/root 178252 2022-09-30 00:13 ./usr/share/doc/php5.6/changelog.gz -rw-r--r-- root/root 21026 2022-09-18 14:52 ./usr/share/doc/php5.6/copyright 2. To install php on nginx… how to prevent it from installing Apache as well? Is installing php-fpm enough to run PHP on nginx? ~# apt-get install --download-only php5.6 Reading package lists... Done Building dependency tree... Done Reading state information... Done The following additional packages will be installed: apache2 apache2-bin apache2-data apache2-utils libapache2-mod-php5.6 libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap liblua5.3-0 libpcre3 php-common php5.6-cli php5.6-common php5.6-json php5.6-opcache php5.6-readline ssl-cert Suggested packages: apache2-doc apache2-suexec-pristine | apache2-suexec-custom The following NEW packages will be installed: apache2 apache2-bin apache2-data apache2-utils libapache2-mod-php5.6 libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap liblua5.3-0 php5.6 php5.6-cli php5.6-common php5.6-json php5.6-opcache php5.6-readline ssl-cert The following packages will be upgraded: libpcre3 php-common 2 upgraded, 17 newly installed, 0 to remove and 32 not upgraded. Need to get 0 B/6,465 kB of archives. After this operation, 22.5 MB of additional disk space will be used.
  3. No, I don't. I'm investigating if it's doable. At this point, I have a working server with php7.4-FPM. The legacy app expects "phpBB 3.0.4: PHP 4.3.3+ (>=4.3.3, >4.4.x, >5.x.x, >6.0-dev (compatible))". I don't know the difference between the "php" package and the "php-fpm" package, especially since I read I shouldn't install the former since it relies on Apache, and therefore installs it. It sems rather easy: https://www.atlantic.net/vps-hosting/host-multiple-websites-with-different-php-versions-on-ubuntu-18-04-vps/
  4. Hello, To migrate a PHP application, I need to install and configure nginx to use PHP 5.x, migrate the app, and then upgrade to PHP 7.x to manage the new version. What's the right way to handle this? Can I simply run eg. "apt install php5.6-fpm php7.4-fpm", and edit nginx's configuration file to point to the right FPM at the right step? Thank you.
  5. Thanks. It's a bit above my head. i just needed to check PHP and MariaDB could work together before trying to install phpBB. I'll read up on error management, etc.
  6. This works: $stmt = $pdo->query('SELECT * FROM mytable'); while ($row = $stmt->fetch()) { echo $row['group_id'] . "\n"; }
  7. If I first add an echo() the error message dispappears… but still no data: <?php // Database settings $db="mydb"; $dbhost="localhost"; $dbport=3306; $dbuser="root"; $dbpasswd="test"; error_reporting(E_ALL); $pdo = new PDO('mysql:host='.$dbhost.';port='.$dbport.';dbname='.$db.'', $dbuser, $dbpasswd); $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); //Required to remove "This page isn’t working" echo("Here"); $pdo->exec("SELECT * FROM mytable" ); $res = $pdo->fetchAll(); foreach ( $res as $row ) { //Still no output echo $row['group_id']; } $pdo = null; ?> So it looks like PHP can successfully connect to MariaDB, and I only have to find why I get no data back (it works with the CLI).
  8. Thanks. No change: <?php // Database settings $db="mydb"; $dbhost="localhost"; $dbport=3306; $dbuser="root"; $dbpasswd="test"; error_reporting(E_ALL); $pdo = new PDO('mysql:host='.$dbhost.';port='.$dbport.';dbname='.$db.'', $dbuser, $dbpasswd); $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $pdo->exec("SELECT * FROM mytable" ); $res = $pdo->fetchAll(); foreach ( $res as $row ) { echo $row['id']; } $pdo = null; ?>
  9. Hello, This is a newbie question. On a test host at home, I first installed nginx and PHP-FPM, and made sure phpinfo(); worked. Next, I installed MariaDB and imported a database. Finally, I tried connecting to it from PHP… and it failed with: Here's the script I used: <?php // Database settings $db="mydb"; $dbhost="localhost"; $dbport=3306; $dbuser="root"; $dbpasswd="test"; $pdo = new PDO('mysql:host='.$dbhost.';port='.$dbport.';dbname='.$db.'', $dbuser, $dbpasswd); $pdo->exec("SELECT * FROM mytable" ); $res = $pdo->fetchAll(); foreach ( $res as $row ) { echo $row['id']; } $pdo = null; ?> Any idea why? Could it be I'm missing a module in PHP? What should I check? Thank you.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.