When creating PDF tickets with Event Tickets and Event Tickets Plus, you may see the following error message: Error during status transition. DirectoryIterator::__construct(/tmp/): failed to open dir: Permission denied

This error message indicates that you don’t have access to the directory needed to create the PDF for your tickets. The good news is that we have a snippet to help you override these permissions and get your tickets working as expected in no time!

Directory access

As we mentioned, the above error indicates that you don’t have access to the /tmp directory on your server: either the /tmp directory doesn’t exist (it usually resides in the root folder of your server), or you don’t have privileges to write to this directory. With privileges -755, you should be able to work with this folder so the plugin can generate and save the QR codes for the ticket emails.

As a first step, we recommend reaching out to your web host to see if they can provide you with access to this directory and/or change the permissions on the directory for your website.

The snippet

If the issue persists, you can add the following snippet to your functions.php file:

<?php


add_filter( 'tribe_ext_pdf_tickets_mpdf_args', function( $args ) {
	$upload_dir = wp_upload_dir();
	$args['tempDir'] = $upload_dir['basedir'] . '/tmp/';
	return $args;
} );