Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fatal Error on Activate Plugin PHP 8.2.25 #1650

Open
marcinkrzeminski opened this issue Dec 17, 2024 · 1 comment
Open

Fatal Error on Activate Plugin PHP 8.2.25 #1650

marcinkrzeminski opened this issue Dec 17, 2024 · 1 comment
Assignees
Labels
bug compatibility PHP or WordPress version compatibility related issue support forum From the WP.org plugin support forum

Comments

@marcinkrzeminski
Copy link
Collaborator

marcinkrzeminski commented Dec 17, 2024

Bug Report

Link to the support forum: https://wordpress.org/support/topic/fatal-error-on-activate-plugin-php-8-2-25/

Expected Behavior

I'm able to activate the plugin when running on PHP 8.2.25

Describe what should happen.

Actual Behavior

Describe what actually happens.

Just sent a site live, installed Stream and it went straight to ‘activate’ (so must have already been installed even though it was not showing). On activate I get ‘Plugin could not be activated because it triggered a fatal error’. I have deleted plugin and reinstalled same deal.

Here’s the log (actual domain replaced with the word ‘site’ in these paths for privacy)

AH01071: Got error ‘PHP message: PHP Warning: Undefined global variable $wp_stream in [/var/www/vhosts/site/httpdocs/wp-content/plugins/stream/stream.php](https://daphne.creativewebhosting.com.au:8443/smb/file-manager/code-editor?currentDir=%2Fhttpdocs%2Fwp-content%2Fplugins%2Fstream&subscriptionId=25&file=stream.php&redirect=%2Fsmb%2Flog-file%2Fbrowser%2Fid%2F25) on line 67; PHP message: PHP Warning: Attempt to read property “install” on null in [/var/www/vhosts/site/httpdocs/wp-content/plugins/stream/includes/db-updates.php](https://daphne.creativewebhosting.com.au:8443/smb/file-manager/code-editor?currentDir=%2Fhttpdocs%2Fwp-content%2Fplugins%2Fstream%2Fincludes&subscriptionId=25&file=db-updates.php&redirect=%2Fsmb%2Flog-file%2Fbrowser%2Fid%2F25) on line 20; PHP message: PHP Fatal error: Uncaught Error: Call to a member function install() on null in [/var/www/vhosts/site/httpdocs/wp-content/plugins/stream/includes/db-updates.php](https://daphne.creativewebhosting.com.au:8443/smb/file-manager/code-editor?currentDir=%2Fhttpdocs%2Fwp-content%2Fplugins%2Fstream%2Fincludes&subscriptionId=25&file=db-updates.php&redirect=%2Fsmb%2Flog-file%2Fbrowser%2Fid%2F25):20\nStack trace:\n#0 [internal function]: wp_stream_update_auto_308()\n#1 [/var/www/vhosts/site/httpdocs/wp-content/plugins/stream/classes/class-install.php](https://daphne.creativewebhosting.com.au:8443/smb/file-manager/code-editor?currentDir=%2Fhttpdocs%2Fwp-content%2Fplugins%2Fstream%2Fclasses&subscriptionId=25&file=class-install.php&redirect=%2Fsmb%2Flog-file%2Fbrowser%2Fid%2F25)(340): call_user_func()\n#2 [/var/www/vhosts/site/httpdocs/wp-content/plugins/stream/classes/class-install.php](https://daphne.creativewebhosting.com.au:8443/smb/file-manager/code-editor?currentDir=%2Fhttpdocs%2Fwp-content%2Fplugins%2Fstream%2Fclasses&subscriptionId=25&file=class-install.php&redirect=%2Fsmb%2Flog-file%2Fbrowser%2Fid%2F25)(111): WP_Stream\\Install->update()\n#3 [/var/www/vhosts/site/httpdocs/wp-content/plugins/stream/classes/class-install.php](https://daphne.creativewebhosting.com.au:8443/smb/file-manager/code-editor?currentDir=%2Fhttpdocs%2Fwp-content%2Fplugins%2Fstream%2Fclasses&subscriptionId=25&file=class-install.php&redirect=%2Fsmb%2Flog-file%2Fbrowser%2Fid%2F25)(77): WP_Stream\\Install->check()\n#4 [/var/www/vhosts/site/httpdocs/wp-content/plugins/stream/classes/class-db-driver-wpdb.php](https://daphne.creativewebhosting.com.au:8443/smb/file-manager/code-editor?currentDir=%2Fhttpdocs%2Fwp-content%2Fplugins%2Fstream%2Fclasses&subscriptionId=25&file=class-db-driver-wpdb.php&redirect=%2Fsmb%2Flog-file%2Fbrowser%2Fid%2F25)(166): WP_Stream\\Install->__construct()\n#5 [/var/www/vhosts/site/httpdocs/wp-content/plugins/stream/classes/class-plugin.php](https://daphne.creativewebhosting.com.au:8443/smb/file-manager/code-editor?currentDir=%2Fhttpdocs%2Fwp-content%2Fplugins%2Fstream%2Fclasses&subscriptionId=25&file=class-plugin.php&redirect=%2Fsmb%2Flog-file%2Fbrowser%2Fid%2F25)(163): WP_Stream\\DB_Driver_WPDB->setup_storage()\n#6 [/var/www/vhosts/site/httpdocs/wp-content/plugins/stream/stream.php](https://daphne.creativewebhosting.com.au:8443/smb/file-manager/code-editor?currentDir=%2Fhttpdocs%2Fwp-content%2Fplugins%2Fstream&subscriptionId=25&file=stream.php&redirect=%2Fsmb%2Flog-file%2Fbrowser%2Fid%2F25)(42): WP_Stream\\Plugin->__construct()\n#…’, referer: https://site/wp-admin/plugins.php

Steps to Reproduce the Problem

Screenshots

Drag and drop screenshots in this area that help illustrate the problem.

System Information

  • Stream plugin version:
  • WordPress version:
  • PHP version 8.2.25
  • Browser:
  • Computer operating system:
@marcinkrzeminski marcinkrzeminski added this to the 4.1.0 milestone Dec 17, 2024
@marcinkrzeminski marcinkrzeminski added bug compatibility PHP or WordPress version compatibility related issue labels Dec 17, 2024
@marcinkrzeminski marcinkrzeminski self-assigned this Dec 17, 2024
@marcinkrzeminski
Copy link
Collaborator Author

Just for a reference I wasn't able to reproduce it on my end. Asked for more details.

Using this Docker setup

# docker-compose.yml

services:
  wordpress:
    build: .
    restart: always
    ports:
      - "8080:80"
    environment:
      - WORDPRESS_DB_HOST=db
      - WORDPRESS_DB_USER=wordpress
      - WORDPRESS_DB_PASSWORD=wordpress_password
      - WORDPRESS_DB_NAME=wordpress
    volumes:
      - wordpress_data:/var/www/html
    depends_on:
      - db

  db:
    image: mysql:8.0
    restart: always
    environment:
      - MYSQL_DATABASE=wordpress
      - MYSQL_USER=wordpress
      - MYSQL_PASSWORD=wordpress_password
      - MYSQL_ROOT_PASSWORD=somewordpress
    volumes:
      - db_data:/var/lib/mysql

volumes:
  wordpress_data:
  db_data:
# Dockerfile
FROM php:8.2.25-apache

# Install required PHP extensions and dependencies
RUN apt-get update && apt-get install -y \
    libfreetype6-dev \
    libjpeg62-turbo-dev \
    libpng-dev \
    libzip-dev \
    && docker-php-ext-configure gd --with-freetype --with-jpeg \
    && docker-php-ext-install -j$(nproc) \
    gd \
    mysqli \
    zip \
    && apt-get clean \
    && rm -rf /var/lib/apt/lists/*

# Download and install WordPress
RUN curl -o wordpress.tar.gz https://wordpress.org/latest.tar.gz \
    && tar -xzf wordpress.tar.gz \
    && mv wordpress/* /var/www/html/ \
    && rm wordpress.tar.gz \
    && rm -rf wordpress \
    && chown -R www-data:www-data /var/www/html

# Copy wp-config.php
RUN mv /var/www/html/wp-config-sample.php /var/www/html/wp-config.php \
    && sed -i 's/database_name_here/wordpress/' /var/www/html/wp-config.php \
    && sed -i 's/username_here/wordpress/' /var/www/html/wp-config.php \
    && sed -i 's/password_here/wordpress_password/' /var/www/html/wp-config.php \
    && sed -i 's/localhost/db/' /var/www/html/wp-config.php

# Configure Apache
RUN a2enmod rewrite

@marcinkrzeminski marcinkrzeminski removed this from the 4.1.0 milestone Dec 18, 2024
@marcinkrzeminski marcinkrzeminski added the support forum From the WP.org plugin support forum label Dec 18, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug compatibility PHP or WordPress version compatibility related issue support forum From the WP.org plugin support forum
Projects
None yet
Development

No branches or pull requests

1 participant