I am trying to learn how to create phars and i am getting this error and have no clue how to fix it. Any ideas?
Fatal error: Uncaught exception 'UnexpectedValueException' with message 'Cannot create phar '/myapp/build/myapp.phar', file extension (or combination) not recognised or the directory does not exist' in /Volumes/www/vhosts/myapp/create-phar.php:11
Stack trace:
#0 /Volumes/www/vhosts/myapp/create-phar.php(11): Phar->__construct('/myapp/build/my...', 256, 'myapp.phar')
#1 {main}
thrown in /Volumes/www/vhosts/myapp/create-phar.php on line 11
I am following the code form this page: packaging your app with phar
Use the full path for windows like
$srcRoot = getcwd() . '/src';
$buildRoot = getcwd() . '/build';
I've been following the same article and the problem are the paths or how they are defined in the first couple of lines, here is what I did:
$srcRoot = "src/";
$buildRoot = "build/";
This solution is for Ubuntu 12.04.3 LTS
Related
my code
<?php
require_once 'vendor/autoload.php';
use Spatie\PdfToText\Pdf;
echo Pdf::getText('simple.pdf');
error message
Fatal error: Uncaught Spatie\PdfToText\Exceptions\CouldNotExtractText: The command ""/usr/bin/pdftotext" simple.pdf -" failed. Exit Code: 1(General error) Working directory: C:\xampp\htdocs\pdf Output: ================ Error Output: ================ The system cannot find the path specified. in C:\xampp\htdocs\pdf\vendor\spatie\pdf-to-text\src\Pdf.php:73 Stack trace: #0 C:\xampp\htdocs\pdf\vendor\spatie\pdf-to-text\src\Pdf.php(84): Spatie\PdfToText\Pdf->text() #1 C:\xampp\htdocs\pdf\index.php(7): Spatie\PdfToText\Pdf::getText('simple.pdf') #2 {main} thrown in C:\xampp\htdocs\pdf\vendor\spatie\pdf-to-text\src\Pdf.php on line 73
pdftext is a .exe file located in your system. Find the path of this file and
then put path like this and pass it to getText method like this
$path = 'c:/Program Files/Git/mingw64/bin/pdftotext';
echo Pdf::getText('simple.pdf', $path);
I hope it'll help you
Note: $path this should be your path of pdftext.exe file
I receive an error that you can see in the bottom of my question when trying to open my Wordpress site.
In the FTP directory I have tried to disable all plugins, then also all themes but it does not help.
Fatal error: Uncaught Error: Call to undefined function
determine_locale() in
/export/sd217/www/jp/r/e/gmoserver/5/4/sd1019254/uniq-table.com/wordpress-4.9.2-ja-jetpack_webfont-undernavicontrol/wp-includes/class-wp-locale-switcher.php:48
Stack trace: #0
/export/sd217/www/jp/r/e/gmoserver/5/4/sd1019254/uniq-table.com/wordpress-4.9.2-ja-jetpack_webfont-undernavicontrol/wp-settings.php(418):
WP_Locale_Switcher->__construct() #1
/export/sd217/www/jp/r/e/gmoserver/5/4/sd1019254/uniq-table.com/wordpress-4.9.2-ja-jetpack_webfont-undernavicontrol/wp-config.php(76):
require_once('/export/sd217/w...') #2
/export/sd217/www/jp/r/e/gmoserver/5/4/sd1019254/uniq-table.com/wordpress-4.9.2-ja-jetpack_webfont-undernavicontrol/wp-load.php(37):
require_once('/export/sd217/w...') #3
/export/sd217/www/jp/r/e/gmoserver/5/4/sd1019254/uniq-table.com/wordpress-4.9.2-ja-jetpack_webfont-undernavicontrol/wp-blog-header.php(13):
require_once('/export/sd217/w...') #4
/export/sd217/www/jp/r/e/gmoserver/5/4/sd1019254/uniq-table.com/index.php(17):
require in
/export/sd217/www/jp/r/e/gmoserver/5/4/sd1019254/uniq-table.com/wordpress-4.9.2-ja-jetpack_webfont-undernavicontrol/wp-includes/class-wp-locale-switcher.php
on line 48
Check below line is available in wp-settings.php
require_once( ABSPATH . WPINC . '/l10n.php' );
and make sure your PHP version is 7.2 or greater.
I was using Wordpress 5.4.2 and downloaded the same version again and simply replaced the old wp-includes folder with the new one from freshly downloaded copy. Everything worked fine after that.
Already installed library using composer
Я уже установил библиотеку через composer
composer require vkcom/vk-php-sdk
But cant initializate it by
однако не выходит её инициализировать через
$vk = new VKApiClient();
Recieve error
Получаю ошибку
Fatal error: Uncaught Error: Class 'VKApiClient' not found in E:\OSPanel\domains\localhost\albom.php:2 Stack trace: #0 {main} thrown in E:\OSPanel\domains\localhost\albom.php on line 2
Directory hierarchy image
Изображение иерархии директорий
I already tried method below:
Также я пробовал способ ниже:
$vk = new \vkapi\src\VK\Client\VKApiClient();
But receive error:
Но получаю ошибку:
Fatal error: Uncaught Error: Class 'vkapi\src\VK\Client\VKApiClient' not found in E:\OSPanel\domains\localhost\albom.php:2 Stack trace: #0 {main} thrown in E:\OSPanel\domains\localhost\albom.php on line 2
Tried use require for composer autoload file, but it still doesnt works well
Уже пробовал использовать require для автозагрузочного файла composer'a, но это всё равно не работает
require '.\vendor\autoload.php';
$vk = new VKApiClient();
Recieve error
Получаю ошибку
Fatal error: Uncaught Error: Class 'VKApiClient' not found in E:\OSPanel\domains\localhost\albom.php:3 Stack trace: #0 {main} thrown in E:\OSPanel\domains\localhost\albom.php on line 3
There are different points here.
First, VKApiClient's namespace is not \vkapi\src\VK\Client\. You can open a file and read the code. It doesn't contain src at all, it does contain namespace VK\Client, so you can initialize client this way
$vk = new \VK\Client\VKApiClient();
Second, you have to include source file. Composer does it via autoload.php. If is not actual somehow, try php composer dump-autoload to refresh autoload file.
Actually, you'd better use English only. Russian SO is here. Have you tried to ask your question there? Though audience is much greater here, I prefer English SO rather that Russian.
Using Suite crm 7.9.1 . newbie to suitecrm.
I created a Person Form in Campaigns module . Created successfully . But when i tried to download it , got the below error .
Fatal error: Uncaught Error: Call to undefined function
mime_content_type() in /home/testsite/public_html/download.php:180
Stack trace: #0
/home/testsite/public_html/include/MVC/Controller/SugarController.php(1007):
require_once() #1
/home/testsite/public_html/include/MVC/Controller/SugarController.php(458):
SugarController->handleEntryPoint() #2
/home/testsite/public_html/include/MVC/Controller/SugarController.php(366):
SugarController->process() #3
/home/testsite/public_html/include/MVC/SugarApplication.php(108):
SugarController->execute() #4
/home/testsite/public_html/index.php(53): SugarApplication->execute()
#5 {main} thrown in /home/testsite/public_html/download.php on line 180
when i browsed on this error got a solution that to install this extension . I am using PHP 7 .
Adding the extensions to cpanel in live , is it safe .. As it is shared host , does it affects other php projects .
When i executed phpinfo found something about mime_type . below
default_mimetype - text/html
mbstring.http_output_conv_mimetypes - ^(text/|application/xhtml\+xml)
You need to install fileinfo extension in order to use mime_content_type. In debian based system you can install it via apt: apt-get install php-mime-type
More info: http://php.net/manual/en/book.fileinfo.php
I was trying to get the mimeType of a file using mime_content_type() but it was not working.
Here this works for me:
$file = $request->file('FILE_NAME_IN_REQUEST');
$mimeType = $file->getClientmimeType();
I'm trying to get a cakephp project up and running from a svn checkout on my mountain lion computer.
I changed all the cache write permissions find but now I have one last fatal error that's not letting the app run.
Fatal error: Uncaught exception 'ConfigureException' with message 'Could not load configuration file: /Users/mike/cake2cribs/cake2cribs/app/Config/core-production.php' in /Users/mike/cake2cribs/cake2cribs/lib/Cake/Configure/PhpReader.php:77
Stack trace: #0
/Users/mike/cake2cribs/cake2cribs/lib/Cake/Core/Configure.php(267):
PhpReader->read('core-production') #1
/Users/mike/cake2cribs/cake2cribs/app/Config/core.php(287):
Configure::load('core-production') #2
/Users/mike/cake2cribs/cake2cribs/lib/Cake/Core/Configure.php(76):
include('/Users/mike/cak...') #3
/Users/mike/cake2cribs/cake2cribs/lib/Cake/bootstrap.php(146):
Configure::bootstrap(true) #4
/Users/mike/cake2cribs/cake2cribs/app/webroot/index.php(81):
include('/Users/mike/cak...') #5 {main} thrown in
/Users/mike/cake2cribs/cake2cribs/lib/Cake/Configure/PhpReader.php on
line 77
it fails on this line inside index.php inside webroot
if (!include ('Cake' . DS . 'bootstrap.php')) {
$failed = true;
}
Any ideas as to what could be the cause?
I've never done an Ubuntu install, I've always just downloaded the source and put it in my webroot. Anyway, cake always expects to have a file called core.php which holds all the config info. Maybe the Ubuntu install just expects core-production.php, so you might just need to copy the core.php file in app/Config and rename it to core-production.php.