Transistor Posted November 23 Share Posted November 23 [PhpPresentation was formerly called PhpPowerpoint but renamed to avoid any issues with Microsoft.] The installation instructions, https://phppowerpoint.readthedocs.io/en/stable/installing.html, give the following instructions: Quote Manual install To install manually, download PHPOfficePHPPresentation package from GitHub and download PHPOfficeCommon package from GitHub. Extract the package and put the contents to your machine. require_once 'path/to/PhpPresentation/src/PhpPresentation/Autoloader.php'; \PhpOffice\PhpPresentation\Autoloader::register(); require_once 'path/to/PhpOffice/Common/src/Common/Autoloader.php'; \PhpOffice\Common\Autoloader::register(); I've downloaded and unzipped the files onto my cPanel (reseller account - so no CLI). Where do I put the lines of code? There are no instructions on the site. Many thanks. Quote Link to comment https://forums.phpfreaks.com/topic/325622-phppresentation-ppt-generator-installation-require_once-lines-where-do-they-go/ Share on other sites More sharing options...
requinix Posted November 23 Share Posted November 23 You put that code in the place where you want to use the library... That is, after all, the reason you have this, right? To make use of it in your own code? Quote Link to comment https://forums.phpfreaks.com/topic/325622-phppresentation-ppt-generator-installation-require_once-lines-where-do-they-go/#findComment-1641153 Share on other sites More sharing options...
Moorcam Posted November 26 Share Posted November 26 On 11/24/2024 at 5:19 AM, Transistor said: [PhpPresentation was formerly called PhpPowerpoint but renamed to avoid any issues with Microsoft.] The installation instructions, https://phppowerpoint.readthedocs.io/en/stable/installing.html, give the following instructions: require_once 'path/to/PhpPresentation/src/PhpPresentation/Autoloader.php'; \PhpOffice\PhpPresentation\Autoloader::register(); require_once 'path/to/PhpOffice/Common/src/Common/Autoloader.php'; \PhpOffice\Common\Autoloader::register(); I've downloaded and unzipped the files onto my cPanel (reseller account - so no CLI). Where do I put the lines of code? There are no instructions on the site. Many thanks. They usually go in the top of the php file where you want to use them. For example, if you want them in index.php, you open index.php and paste them at the top: <?php // index.php require_once 'path/to/PhpPresentation/src/PhpPresentation/Autoloader.php'; \PhpOffice\PhpPresentation\Autoloader::register(); require_once 'path/to/PhpOffice/Common/src/Common/Autoloader.php'; \PhpOffice\Common\Autoloader::register(); // and whatever after that ?> Just change the paths to reflect the file locations. Quote Link to comment https://forums.phpfreaks.com/topic/325622-phppresentation-ppt-generator-installation-require_once-lines-where-do-they-go/#findComment-1642293 Share on other sites More sharing options...
Transistor Posted Sunday at 07:02 PM Author Share Posted Sunday at 07:02 PM Thanks, guys. I didn't get back to this for a week. I found that there was an error in the folder names after unpacking the files. The sample files all include `Sample_Header.php` (located in the samples folder. This has the lines, if (is_file(__DIR__ . '/../../Common/src/Common/Autoloader.php')) { include_once __DIR__ . '/../../Common/src/Common/Autoloader.php'; PhpOffice\Common\Autoloader::register(); } else { throw new Exception('Can not find the vendor or the common folder!'); } but the extraction of the install files created `Common-master`. Renaming the higher-level folder to `Common` seems to have resolved the problem. Hopefully this will help someone else. Quote Link to comment https://forums.phpfreaks.com/topic/325622-phppresentation-ppt-generator-installation-require_once-lines-where-do-they-go/#findComment-1644984 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.