I'm trying to send an email from the WordPress REST API. This email has some file attached to it, that are sent from a JavaScript front end. I can get the data and the file, but I can't attach those files to the mail, it returns me this error :
Fatal error: Uncaught TypeError: preg_match(): Argument #2 ($subject) must be of type string, array given in /var/www/html/wp-includes/PHPMailer/PHPMailer.php:1853
Stack trace:
#0 /var/www/html/wp-includes/PHPMailer/PHPMailer.php(1853): preg_match('#^[a-z][a-z\\d+....', Array)
#1 /var/www/html/wp-includes/PHPMailer/PHPMailer.php(1865): PHPMailer\PHPMailer\PHPMailer::isPermittedPath(Array)
#2 /var/www/html/wp-includes/PHPMailer/PHPMailer.php(3193): PHPMailer\PHPMailer\PHPMailer::fileIsAccessible(Array)
#3 /var/www/html/wp-includes/pluggable.php(522): PHPMailer\PHPMailer\PHPMailer->addAttachment(Array)
#4 /var/www/html/wp-content/plugins/my-project/views/API/email.php(100): wp_mail(Array, 'Demande de fina...', '\n\t<h1>Demande d...', Array, Array)
#5 /var/www/html/wp-includes/rest-api/class-wp-rest-server.php(1171): financement_email(Object(WP_REST_Request))
#6 /var/www/html/wp-includes/rest-api/class-wp-rest-server.php(1018): WP_REST_Server->respond_to_request(Object(WP_REST_Request), '/my-project/fin...', Array, NULL)
#7 /var/www/html/wp-includes/rest-api/class-wp-rest-server.php(442): WP_REST_Server->dispatch(Object(WP_REST_Request))
#8 /var/www/html/wp-includes/rest-api.php(410): WP_REST_Server->serve_request('/my-project/fin...')
#9 /var/www/html/wp-includes/class-wp-hook.php(308): rest_api_loaded(Object(WP))
#10 /var/www/html/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters('', Array)
#11 /var/www/html/wp-includes/plugin.php(565): WP_Hook->do_action(Array)
#12 /var/www/html/wp-includes/class-wp.php(399): do_action_ref_array('parse_request', Array)
#13 /var/www/html/wp-includes/class-wp.php(780): WP->parse_request('')
#14 /var/www/html/wp-includes/functions.php(1332): WP->main('')
#15 /var/www/html/wp-blog-header.php(16): wp()
#16 /var/www/html/index.php(17): require('/var/www/html/w...')
#17 {main}
thrown in /var/www/html/wp-includes/PHPMailer/PHPMailer.php on line 1853
I get the files like this :
$files = $request->get_file_params();
I call the wp_mail function like this :
wp_mail( $to, $subject, $body, $headers, $files)
The fifth parameter to wp_mail expects only an array of absolute file paths.
get_file_params() is basically a pass-through to the global $_FILES which contains an array of arrays with known keys, including tmp_name, which should be the absolute path on disk that the file temporarily lives.
You should be able to use array_column to get an array of just absolute paths.
$cleanFiles = array_column($files, 'tmp_name');
Demo: https://3v4l.org/FS1kV
Related
I recently changed the php version from 7.4 to 8.1
But after the change, I get an error when posting content in WordPress
You need to know that despite this error, the article will be sent, but this error has bothered me
I activated the WordPress debugger, the error was referring to the active plugin in WordPress
This line:
$pictureFile = file_get_contents($imageFilePath);
WP_DEBUG :
Fatal error: Uncaught ValueError: Path cannot be empty in /home/admin/domains/xxx.org/public_html/wp-content/plugins/mp3publisher7/mp3-post-publisher.php:113
Stack trace:
#0 /home/admin/domains/xxx.org/public_html/wp-content/plugins/mp3publisher7/mp3-post-publisher.php(113): file_get_contents()
#1 /home/admin/domains/xxx.org/public_html/wp-includes/class-wp-hook.php(310): save_mp3_post_publisher()
#2 /home/admin/domains/xxx.org/public_html/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters()
#3 /home/admin/domains/xxx.org/public_html/wp-includes/plugin.php(517): WP_Hook->do_action()
#4 /home/admin/domains/xxx.org/public_html/wp-includes/post.php(4717): do_action()
#5 /home/admin/domains/xxx.org/public_html/wp-includes/revision.php(337): wp_insert_post()
#6 /home/admin/domains/xxx.org/public_html/wp-includes/revision.php(191): _wp_put_post_revision()
#7 /home/admin/domains/xxx.org/public_html/wp-includes/class-wp-hook.php(310): wp_save_post_revision()
#8 /home/admin/domains/xxx.org/public_html/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters()
#9 /home/admin/domains/xxx.org/public_html/wp-includes/plugin.php(517): WP_Hook->do_action()
#10 /home/admin/domains/xxx.org/public_html/wp-includes/post.php(4686): do_action()
#11 /home/admin/domains/xxx.org/public_html/wp-includes/post.php(4819): wp_insert_post()
#12 /home/admin/domains/xxx.org/public_html/wp-admin/includes/post.php(426): wp_update_post()
#13 /home/admin/domains/xxx.org/public_htm/wp-admin/post.php(227): edit_post()
#14 {main} thrown in /home/admin/domains/xxx.org/public_html/wp-content/plugins/mp3publisher7/mp3-post-publisher.php on line 113
More complete code of this plugin :
$mp3FilePath = get_attached_file($_POST["mp3_file_id"]);
$thumb_id = get_post_thumbnail_id($postId);
$imageFilePath = get_attached_file($thumb_id);
$pictureFile = file_get_contents($imageFilePath);
$info = array(
"artist"=>$_POST["mp3_artist"],
"album"=>$_POST["mp3_album"],
"comment"=>$_POST["mp3_comment"],
"title"=>$_POST["mp3_caption"],
"cover_data" => array(
array (
'data'=> $pictureFile,
'picturetypeid'=> 3,
'mime'=> 'image/jpeg',
'description' => 'My Picture'
)
)
When I disable this plugin, there is no problem in posting
After deleting the following line, the problem will be solved, but some parts of the plugin will not work anymore:
// $pictureFile = file_get_contents($imageFilePath);
If anyone can please help. I can't think of anything anymore
tnx..........................
The error is not occurring with file_get_contents(), but your variable $imageFilePath is returning a null value.
Try console log echo("<script>console.log('The value of imageFilePath is : " . $imageFilePath . "');</script>");
As detailed here https://symfony.com/blog/new-in-symfony-3-1-deprecation-helper-improvements, I've set SYMFONY_DEPRECATIONS_HELPER to a regex of the deprecation message like this in phpunit.xml:
<env name="SYMFONY_DEPRECATIONS_HELPER" value="/Relying on entity queries to check access/" />
However, the resulting backtrace isn't useful at all, as in only shows a trace through the innards of Symfony and PHPUnit and not the code with the deprecation at all:
Self deprecation triggered by Drupal\Tests\MYMODULE\Kernel\ProjectUpdateTest::testProjectCreationCommonsWorker:
Relying on entity queries to check access by default is deprecated in drupal:9.2.0 and an error will be thrown from drupal:10.0.0. Call \Drupal\Core\Entity\Query\QueryInterface::accessCheck() with TRUE or FALSE to specify whether access should be checked. See https://www.drupal.org/node/3201242
Stack trace:
#0 [internal function]: Symfony\Bridge\PhpUnit\DeprecationErrorHandler->handleError(16384, 'a:5:{s:11:"depr...', '/Users/joachim/...', 291, Array)
#1 core/tests/Drupal/Tests/Listeners/DeprecationListenerTrait.php(150): call_user_func(Array, 16384, 'a:5:{s:11:"depr...', '/Users/joachim/...', 291, Array)
#2 [internal function]: Drupal\Tests\Listeners\DrupalListener->Drupal\Tests\Listeners\{closure}(16384, 'a:5:{s:11:"depr...', '/Users/joachim/...', 291)
#3 /Users/joachim/Sites/MYPROJECT/vendor/symfony/phpunit-bridge/Legacy/SymfonyTestsListenerTrait.php(291): trigger_error('a:5:{s:11:"depr...', 16384)
#4 /Users/joachim/Sites/MYPROJECT/vendor/symfony/phpunit-bridge/Legacy/SymfonyTestsListenerForV7.php(59): Symfony\Bridge\PhpUnit\Legacy\SymfonyTestsListenerTrait->endTest(Object(Drupal\Tests\MYMODULE\Kernel\ProjectUpdateTest), 143.932270373)
#5 core/tests/Drupal/Tests/Listeners/DrupalListener.php(127): Symfony\Bridge\PhpUnit\Legacy\SymfonyTestsListenerForV7->endTest(Object(Drupal\Tests\MYMODULE\Kernel\ProjectUpdateTest), 143.932270373)
#6 /Users/joachim/Sites/MYPROJECT/vendor/phpunit/phpunit/src/Framework/TestResult.php(450): Drupal\Tests\Listeners\DrupalListener->endTest(Object(Drupal\Tests\MYMODULE\Kernel\ProjectUpdateTest), 143.932270373)
#7 /Users/joachim/Sites/MYPROJECT/vendor/phpunit/phpunit/src/Util/PHP/AbstractPhpProcess.php(377): PHPUnit\Framework\TestResult->endTest(Object(Drupal\Tests\MYMODULE\Kernel\ProjectUpdateTest), 143.932270373)
#8 /Users/joachim/Sites/MYPROJECT/vendor/phpunit/phpunit/src/Util/PHP/AbstractPhpProcess.php(187): PHPUnit\Util\PHP\AbstractPhpProcess->processChildResult(Object(Drupal\Tests\MYMODULE\Kernel\ProjectUpdateTest), Object(PHPUnit\Framework\TestResult), 'a:4:{s:10:"test...', '')
#9 sites/simpletest/TestCase.php(903): PHPUnit\Util\PHP\AbstractPhpProcess->runTestJob('<?php\nuse PHPUn...', Object(Drupal\Tests\MYMODULE\Kernel\ProjectUpdateTest), Object(PHPUnit\Framework\TestResult))
#10 /Users/joachim/Sites/MYPROJECT/vendor/phpunit/phpunit/src/Framework/TestSuite.php(677): PHPUnit\Framework\TestCase->run(Object(PHPUnit\Framework\TestResult))
#11 /Users/joachim/Sites/MYPROJECT/vendor/phpunit/phpunit/src/TextUI/TestRunner.php(673): PHPUnit\Framework\TestSuite->run(Object(PHPUnit\Framework\TestResult))
#12 /Users/joachim/Sites/MYPROJECT/vendor/phpunit/phpunit/src/TextUI/Command.php(143): PHPUnit\TextUI\TestRunner->run(Object(PHPUnit\Framework\TestSuite), Array, Array, true)
#13 /Users/joachim/Sites/MYPROJECT/vendor/phpunit/phpunit/src/TextUI/Command.php(96): PHPUnit\TextUI\Command->run(Array, true)
#14 /Users/joachim/Sites/MYPROJECT/vendor/phpunit/phpunit/phpunit(98): PHPUnit\TextUI\Command::main()
#15 /Users/joachim/Sites/MYPROJECT/vendor/bin/phpunit(120): include('/Users/joachim/...')
#16 {main}
How do I get it to show the relevant information?
I am trying to organize my project (lumen / laravel) in such a way that my controls are in subfolders to have more control. I am following the official lumen guide (https://lumen.laravel.com/docs/6.x/controllers) but the problem is as follows:
In my route file (routes/web.php) I have the following code:
<?php
$router->get('test', 'Photos\TestController#show');
And my controller is located in the path app/Http/Controllers/Photos/TestController.php and has the following code:
<?php
namespace App\Http\Controllers;
class TestController extends Controller
{
public function show(){
return "hello";
}
}
But at the time of making a request to the url http://localhost/myproject/public/test I get the following message:
Click to view
And in my log file (storage/logs/lumen-xx-xx-xx.log) I get the following error:
[2020-01-19 02:59:12] local.ERROR: ReflectionException: Class App\Http\Controllers\Photos\TestController does not exist in C:\xampp\htdocs\colegio\vendor\illuminate\container\Container.php:803
Stack trace:
#0 C:\xampp\htdocs\colegio\vendor\illuminate\container\Container.php(803): ReflectionClass->__construct('App\\Http\\Contro...')
#1 C:\xampp\htdocs\colegio\vendor\illuminate\container\Container.php(681): Illuminate\Container\Container->build('App\\Http\\Contro...')
#2 C:\xampp\htdocs\colegio\vendor\illuminate\container\Container.php(629): Illuminate\Container\Container->resolve('App\\Http\\Contro...', Array)
#3 C:\xampp\htdocs\colegio\vendor\laravel\lumen-framework\src\Application.php(267): Illuminate\Container\Container->make('App\\Http\\Contro...', Array)
#4 C:\xampp\htdocs\colegio\vendor\laravel\lumen-framework\src\Concerns\RoutesRequests.php(311): Laravel\Lumen\Application->make('App\\Http\\Contro...')
#5 C:\xampp\htdocs\colegio\vendor\laravel\lumen-framework\src\Concerns\RoutesRequests.php(278): Laravel\Lumen\Application->callControllerAction(Array)
#6 C:\xampp\htdocs\colegio\vendor\laravel\lumen-framework\src\Concerns\RoutesRequests.php(263): Laravel\Lumen\Application->callActionOnArrayBasedRoute(Array)
#7 C:\xampp\htdocs\colegio\vendor\laravel\lumen-framework\src\Concerns\RoutesRequests.php(165): Laravel\Lumen\Application->handleFoundRoute(Array)
#8 C:\xampp\htdocs\colegio\vendor\laravel\lumen-framework\src\Concerns\RoutesRequests.php(416): Laravel\Lumen\Application->Laravel\Lumen\Concerns\{closure}(Object(Laravel\Lumen\Http\Request))
#9 C:\xampp\htdocs\colegio\vendor\laravel\lumen-framework\src\Concerns\RoutesRequests.php(171): Laravel\Lumen\Application->sendThroughPipeline(Array, Object(Closure))
#10 C:\xampp\htdocs\colegio\vendor\laravel\lumen-framework\src\Concerns\RoutesRequests.php(108): Laravel\Lumen\Application->dispatch(NULL)
#11 C:\xampp\htdocs\colegio\public\index.php(28): Laravel\Lumen\Application->run()
#12 {main}
Next Illuminate\Contracts\Container\BindingResolutionException: Target class [App\Http\Controllers\Photos\TestController] does not exist. in C:\xampp\htdocs\colegio\vendor\illuminate\container\Container.php:805
Stack trace:
#0 C:\xampp\htdocs\colegio\vendor\illuminate\container\Container.php(681): Illuminate\Container\Container->build('App\\Http\\Contro...')
#1 C:\xampp\htdocs\colegio\vendor\illuminate\container\Container.php(629): Illuminate\Container\Container->resolve('App\\Http\\Contro...', Array)
#2 C:\xampp\htdocs\colegio\vendor\laravel\lumen-framework\src\Application.php(267): Illuminate\Container\Container->make('App\\Http\\Contro...', Array)
#3 C:\xampp\htdocs\colegio\vendor\laravel\lumen-framework\src\Concerns\RoutesRequests.php(311): Laravel\Lumen\Application->make('App\\Http\\Contro...')
#4 C:\xampp\htdocs\colegio\vendor\laravel\lumen-framework\src\Concerns\RoutesRequests.php(278): Laravel\Lumen\Application->callControllerAction(Array)
#5 C:\xampp\htdocs\colegio\vendor\laravel\lumen-framework\src\Concerns\RoutesRequests.php(263): Laravel\Lumen\Application->callActionOnArrayBasedRoute(Array)
#6 C:\xampp\htdocs\colegio\vendor\laravel\lumen-framework\src\Concerns\RoutesRequests.php(165): Laravel\Lumen\Application->handleFoundRoute(Array)
#7 C:\xampp\htdocs\colegio\vendor\laravel\lumen-framework\src\Concerns\RoutesRequests.php(416): Laravel\Lumen\Application->Laravel\Lumen\Concerns\{closure}(Object(Laravel\Lumen\Http\Request))
#8 C:\xampp\htdocs\colegio\vendor\laravel\lumen-framework\src\Concerns\RoutesRequests.php(171): Laravel\Lumen\Application->sendThroughPipeline(Array, Object(Closure))
#9 C:\xampp\htdocs\colegio\vendor\laravel\lumen-framework\src\Concerns\RoutesRequests.php(108): Laravel\Lumen\Application->dispatch(NULL)
#10 C:\xampp\htdocs\colegio\public\index.php(28): Laravel\Lumen\Application->run()
#11 {main} {"exception":"[object] (Illuminate\\Contracts\\Container\\BindingResolutionException(code: 0): Target class [App\\Http\\Controllers\\Photos\\TestController] does not exist. at C:\\xampp\\htdocs\\colegio\\vendor\\illuminate\\container\\Container.php:805)
[stacktrace]
#0 C:\\xampp\\htdocs\\colegio\\vendor\\illuminate\\container\\Container.php(681): Illuminate\\Container\\Container->build('App\\\\Http\\\\Contro...')
#1 C:\\xampp\\htdocs\\colegio\\vendor\\illuminate\\container\\Container.php(629): Illuminate\\Container\\Container->resolve('App\\\\Http\\\\Contro...', Array)
#2 C:\\xampp\\htdocs\\colegio\\vendor\\laravel\\lumen-framework\\src\\Application.php(267): Illuminate\\Container\\Container->make('App\\\\Http\\\\Contro...', Array)
#3 C:\\xampp\\htdocs\\colegio\\vendor\\laravel\\lumen-framework\\src\\Concerns\\RoutesRequests.php(311): Laravel\\Lumen\\Application->make('App\\\\Http\\\\Contro...')
#4 C:\\xampp\\htdocs\\colegio\\vendor\\laravel\\lumen-framework\\src\\Concerns\\RoutesRequests.php(278): Laravel\\Lumen\\Application->callControllerAction(Array)
#5 C:\\xampp\\htdocs\\colegio\\vendor\\laravel\\lumen-framework\\src\\Concerns\\RoutesRequests.php(263): Laravel\\Lumen\\Application->callActionOnArrayBasedRoute(Array)
#6 C:\\xampp\\htdocs\\colegio\\vendor\\laravel\\lumen-framework\\src\\Concerns\\RoutesRequests.php(165): Laravel\\Lumen\\Application->handleFoundRoute(Array)
#7 C:\\xampp\\htdocs\\colegio\\vendor\\laravel\\lumen-framework\\src\\Concerns\\RoutesRequests.php(416): Laravel\\Lumen\\Application->Laravel\\Lumen\\Concerns\\{closure}(Object(Laravel\\Lumen\\Http\\Request))
#8 C:\\xampp\\htdocs\\colegio\\vendor\\laravel\\lumen-framework\\src\\Concerns\\RoutesRequests.php(171): Laravel\\Lumen\\Application->sendThroughPipeline(Array, Object(Closure))
#9 C:\\xampp\\htdocs\\colegio\\vendor\\laravel\\lumen-framework\\src\\Concerns\\RoutesRequests.php(108): Laravel\\Lumen\\Application->dispatch(NULL)
#10 C:\\xampp\\htdocs\\colegio\\public\\index.php(28): Laravel\\Lumen\\Application->run()
#11 {main}
[previous exception] [object] (ReflectionException(code: -1): Class App\\Http\\Controllers\\Photos\\TestController does not exist at C:\\xampp\\htdocs\\colegio\\vendor\\illuminate\\container\\Container.php:803)
[stacktrace]
#0 C:\\xampp\\htdocs\\colegio\\vendor\\illuminate\\container\\Container.php(803): ReflectionClass->__construct('App\\\\Http\\\\Contro...')
#1 C:\\xampp\\htdocs\\colegio\\vendor\\illuminate\\container\\Container.php(681): Illuminate\\Container\\Container->build('App\\\\Http\\\\Contro...')
#2 C:\\xampp\\htdocs\\colegio\\vendor\\illuminate\\container\\Container.php(629): Illuminate\\Container\\Container->resolve('App\\\\Http\\\\Contro...', Array)
#3 C:\\xampp\\htdocs\\colegio\\vendor\\laravel\\lumen-framework\\src\\Application.php(267): Illuminate\\Container\\Container->make('App\\\\Http\\\\Contro...', Array)
#4 C:\\xampp\\htdocs\\colegio\\vendor\\laravel\\lumen-framework\\src\\Concerns\\RoutesRequests.php(311): Laravel\\Lumen\\Application->make('App\\\\Http\\\\Contro...')
#5 C:\\xampp\\htdocs\\colegio\\vendor\\laravel\\lumen-framework\\src\\Concerns\\RoutesRequests.php(278): Laravel\\Lumen\\Application->callControllerAction(Array)
#6 C:\\xampp\\htdocs\\colegio\\vendor\\laravel\\lumen-framework\\src\\Concerns\\RoutesRequests.php(263): Laravel\\Lumen\\Application->callActionOnArrayBasedRoute(Array)
#7 C:\\xampp\\htdocs\\colegio\\vendor\\laravel\\lumen-framework\\src\\Concerns\\RoutesRequests.php(165): Laravel\\Lumen\\Application->handleFoundRoute(Array)
#8 C:\\xampp\\htdocs\\colegio\\vendor\\laravel\\lumen-framework\\src\\Concerns\\RoutesRequests.php(416): Laravel\\Lumen\\Application->Laravel\\Lumen\\Concerns\\{closure}(Object(Laravel\\Lumen\\Http\\Request))
#9 C:\\xampp\\htdocs\\colegio\\vendor\\laravel\\lumen-framework\\src\\Concerns\\RoutesRequests.php(171): Laravel\\Lumen\\Application->sendThroughPipeline(Array, Object(Closure))
#10 C:\\xampp\\htdocs\\colegio\\vendor\\laravel\\lumen-framework\\src\\Concerns\\RoutesRequests.php(108): Laravel\\Lumen\\Application->dispatch(NULL)
#11 C:\\xampp\\htdocs\\colegio\\public\\index.php(28): Laravel\\Lumen\\Application->run()
#12 {main}
"}
I would like to know what I am doing wrong, since I read the documentation several times and I still can't find the solution, I also searched the internet and nobody has asked about it. Thank you very much in advance.
Since your controllers are located in a subfolder, therefore you need to change also the namespace of it by adding the subfolder of it like below.
namespace App\Http\Controllers\Photos
Then to be able to extend your controller to a Controller class. Put this code also.
use App\Http\Controllers\Controller
I've created a BigTable instance in my GC account and when I'm trying to connect to it using Google's library (this is a sample code from Google's docs):
require 'vendor/autoload.php';
use Google\Cloud\Bigtable\BigtableClient;
/** Uncomment and populate these variables in your code */
$project_id = 'my_project_id';
$instance_id = 'table_instance';
$table_id = 'table_name';
// Connect to an existing table with an existing instance.
$dataClient = new BigtableClient([
'projectId' => $project_id,
]);
$table = $dataClient->table($instance_id, $table_id);
$key = 'r1';
// Read a row from my-table using a row key
$row = $table->readRow($key);
$column_family_id = 'cf1';
$column_id = 'c1';
// Get the Value from the Row, using the column_family_id and column_id
$value = $row[$column_family_id][$column_id][0]['value'];
printf("Row key: %s\nData: %s\n", $key, $value);
I'm getting an error:
Fatal error: Uncaught BadMethodCallException: Streaming calls are not supported while using the REST transport. in /srv/vendor/google/gax/src/Transport/HttpUnaryTransportTrait.php:119 Stack trace: #0 /srv/vendor/google/gax/src/Transport/HttpUnaryTransportTrait.php(63): Google\ApiCore\Transport\RestTransport->throwUnsupportedException() #1 /srv/vendor/google/gax/src/GapicClientTrait.php(479): Google\ApiCore\Transport\RestTransport->startServerStreamingCall(Object(Google\ApiCore\Call), Array) #2 /srv/vendor/google/gax/src/Middleware/CredentialsWrapperMiddleware.php(61): Google\Cloud\Bigtable\V2\Gapic\BigtableGapicClient->Google\ApiCore\{closure}(Object(Google\ApiCore\Call), Array) #3 /srv/vendor/google/gax/src/Middleware/FixedHeaderMiddleware.php(67): Google\ApiCore\Middleware\CredentialsWrapperMiddleware->__invoke(Object(Google\ApiCore\Call), Array) #4 /srv/vendor/google/gax/src/Middleware/RetryMiddleware.php(85): Google\ApiCore\Middleware\FixedHeaderMiddleware->__invoke(Object(Google\ApiCore\Call), Array) #5 /srv/vendor/google/gax/src/Middleware/OptionsFilterMiddleware.php(64): Google\ApiCore\Middleware\RetryMiddleware->__invoke(Object(Google\ApiCore\Call), Array) #6 /srv/vendor/google/gax/src/GapicClientTrait.php(462): Google\ApiCore\Middleware\OptionsFilterMiddleware->__invoke(Object(Google\ApiCore\Call), Array) #7 /srv/vendor/google/cloud-bigtable/src/V2/Gapic/BigtableGapicClient.php(357): Google\Cloud\Bigtable\V2\Gapic\BigtableGapicClient->startCall('ReadRows', 'Google\\Cloud\\Bi...', Array, Object(Google\Cloud\Bigtable\V2\ReadRowsRequest), 3) #8 [internal function]: Google\Cloud\Bigtable\V2\Gapic\BigtableGapicClient->readRows('projects/project...', Array) #9 /srv/vendor/google/cloud-core/src/ExponentialBackoff.php(80): call_user_func_array(Array, Array) #10 /srv/vendor/google/cloud-bigtable/src/ResumableStream.php(96): Google\Cloud\Core\ExponentialBackoff->execute(Array, Array) #11 /srv/vendor/google/cloud-bigtable/src/ChunkFormatter.php(168): Google\Cloud\Bigtable\ResumableStream->readAll() #12 [internal function]: Google\Cloud\Bigtable\ChunkFormatter->readAll() #13 /srv/vendor/google/cloud-bigtable/src/Table.php(331): Generator->current() #14 /srv/index.php(24): Google\Cloud\Bigtable\Table->readRow('r1') #15 {main} thrown in /srv/vendor/google/gax/src/Transport/HttpUnaryTransportTrait.php on line 119
Any help?
OK, I figured it out.
For those who facing the same problem:
create/add a line into your php.ini file:
extension=grpc.so
php.ini should be in the same directory with app.yaml
Hi i am new in Zend Framework. i am working with existing project.
Here,
$url = $this->view->url(array('controller' => $user->status), 'default', true);
$url = $this->_getParam('url', $url);
$this->_redirect($url);
it is redirected to another page but there i get following error:
Exception information:
Message: Mysqli statement execute error : No data supplied for parameters in prepared statement
Stack trace:
#0 C:\web\Apache2\php\Zend\1.11.3\library\Zend\Db\Statement.php(300): Zend_Db_Statement_Mysqli->_execute(Array)
#1 C:\web\Apache2\php\Zend\1.11.3\library\Zend\Db\Adapter\Abstract.php(479): Zend_Db_Statement->execute(Array)
#2 C:\web\Apache2\php\Zend\1.11.3\library\Zend\Db\Table\Abstract.php(1526): Zend_Db_Adapter_Abstract->query(Object(Zend_Db_Table_Select))
#3 C:\web\Apache2\php\Zend\1.11.3\library\Zend\Db\Table\Abstract.php(1388): Zend_Db_Table_Abstract->_fetch(Object(Zend_Db_Table_Select))
#4 C:\web\Apache2\htdocs\application\modules\default\controllers\generalController.php(24): Zend_Db_Table_Abstract->fetchRow(Object(Zend_Db_Table_Select))
#5 C:\web\Apache2\php\Zend\1.11.3\library\Zend\Controller\Action.php(513): generalController->indexAction()
#6 C:\web\Apache2\php\Zend\1.11.3\library\Zend\Controller\Dispatcher\Standard.php(295): Zend_Controller_Action->dispatch('indexAction')
#7 C:\web\Apache2\php\Zend\1.11.3\library\Zend\Controller\Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
#8 C:\web\Apache2\php\Zend\1.11.3\library\Zend\Application\Bootstrap\Bootstrap.php(97): Zend_Controller_Front->dispatch()
#9 C:\web\Apache2\php\Zend\1.11.3\library\Zend\Application.php(366): Zend_Application_Bootstrap_Bootstrap->run()
#10 C:\web\Apache2\htdocs\public\index.php(59): Zend_Application->run()
#11 {main}
but if i refresh page everything get OK, i dont get error
i can not understand what is the problem
can anyone help me please?