Problem with configuration of LiveQuery in Parseplatform - php

Hello i have installed Parse server and parse sdk for php on my Linux Centos Server.
Parse Dashboard: 1.3.3,
Server version: 4.3.0
I'm managing those db's using php code. This parser was installed by someone else. The thing is I'm not sure how to install LiveQuery for my server. I don't know if my version of server is good for this kind of operations. I found some solutions how to enable this feature, but there was something like "index.js" - in my file system it's app.js. Screen of file system
In app.js i added lines:
liveQuery: {
classNames: ["Test"] //List of classes to support for query subscritions
}
I've created class in my db named "Test", then i found solution i need to add
this line
liveQueryUrl: keyLiveQueryUrl, // Required if using LiveQuery
I don't really know how to get this key.
How can i check if LiveQuery works? It will be used by flutter code, but i'd like to check it first in PHP.

My problem has been solved in my other extended topic here.

Related

Quickest way to get Expression Engine v 2.5.5 working with PHP7

A client’s host has recently updated their server to run PHP 7, which has broken their EE 2.5.5. site (“Call to undefined function mysql_connect()”).
I tried upgrading EE to version 2.11.9 but get errors:
Frontend: can’t find safecracker_lib
Control Panel: PATH_MOD not defined in mod_structure.php, fixing this leads down a rabbit hole starting with an error related to not being able to instantiate the pagination class somewhere.
I just need to get the site running until I build a new site, what is the quickest way I can get the site running with PHP 7?
In your config folder there is a file named database.php
change the line:
$db['expressionengine']['dbdriver'] = 'mysql';
to
$db['expressionengine']['dbdriver'] = 'mysqli';
mysql_connect() has been deprecated since PHP 5 and removed in PHP 7 so you cannot use this function or any of the old mysql functions.
You need to upgrade your codebase, or downgrade your PHP version (highly discouraged).
In regards to your missing pagination class, you may not have implemented core classes that were required when upgrading.
Try running on your command line:
php system/ee/eecms upgrade
You can also read the documentation on how to upgrade the codebase for Expression Engine here.

PHP class 'Ds\Map' not found

In PHP (version 7.1), I am attempting to use a MAP as opposed to a two dimensional array to handle implicit data type conversion across different data type groups. However, I am receiving the following run-time error:
Class 'Ds\Map' not found
The error occurs on this line of code:
protected $hive_data_type_group_map = new \Ds\Map();
I have checked online, but there is little documentation on Ds\Map, even on PHP's website (click here). Does anyone know how to fix this?
Data Structures is not a built-in PHP extension.
It needs to be installed before use. The installation instructions are available on php.net.
For windows
Download compiled-dll file "php_ds.dll" from https://pecl.php.net/package/ds. Place it in your dir wamp\bin\php\[your_php_version_folder]\ext and include it in your ".ini" file.
It worked for me.
the easiest way on ubuntu:
pecl install ds
Reference: https://www.php.net/manual/en/ds-deque.allocate.php

Connection to Simpro API not working - Tivoka send is failing

I'm having trouble connecting to our Simpro server via the API.
I am using a slightly modified version of the directaccessexample.php as per the Simpro GIT repository here - https://github.com/simPRO-Software/simpro-api-php
My server PHP version is 5.6.32
My composer is loading the below packages:
{
"require": {
"monolog/monolog": "",
"eher/OAuth": "1.0.",
"tivoka/tivoka": "3.1.0",
"psr/log":"*"
}
}
In my attempts to debug, the Client.php script (as provided by the Simpro GIT) appears to fail at specifically the send call from the below lines:
$rpcRequest = new \Tivoka\Client\Request($method, $args);
$this->connection->send($rpcRequest);
I have identified this by outputting to error_log above and below this line - the code appears to die in the function on the send request (and therefore never reaches the second error_log output. There is no error logged that I can see which I find bizarre, it just appears to exit the function.
I am not seeing any other errors in any php error log/apache log/etc, and I've ruled out the issue being the firewall on my server.
I am wondering if this is a problem with versions of PHP or the installed packages from composer - though I have tried a couple of different specific versions without any luck (no change to php version, however).
From the above code, the json_encoded output of $rpcRequest is:
{"id":"7b0911cc-dd67-4032-b810-474e549edecc","method":"CompanySearch","params":["%"],"request":null,"response":null,"result":null,"error":null,"errorMessage":null,"errorData":null,"responseHeaders":null,"responseHeadersRaw":null}
Can anybody assist here? I am pulling my hair out. I'm aware I could attempt to write my own code using different oauth/rpc packages but I am not that advanced with PHP.
Thanks,
Justin.

CakePHP 3.0 not running on other machines

I've developed a small project on a machine, using CakePHP 3.0, and I need it to run on another machine. I've tried to install it on several other machines.
If I run the composer to install the CakePHP 3.0, then I copy my stuff to overwrite it, the project works. I've tried this on two machines and had no problem so far. If I don't run the composer, and just copy the stuff to the target machine, it gives me the following error. I've tried this on 3 machines, and every machine gives me this:
Fatal error: Class 'Locale' not found in /home/u113681897/public_html/vendor/cakephp/cakephp/src/I18n/I18n.php on line 229
Fatal error: Class 'Locale' not found in /home/u113681897/public_html/vendor/cakephp/cakephp/src/I18n/I18n.php on line 229
I've copied the whole project to this server to test.
I told you this because I thought it has something to do with my problem. The point is that I have to run this on a machine that is not mine, and I can't install composer on it. The /public_html/vendor/cakephp/cakephp/src/I18n/ has files related to internationalization and localization, but my project will never be translated, so a workaround to make the project ignore those files would be enough to solve my problem.
The following code is an excerpt from the (...)/I18n/I18n.php that might be relevant:
<?php
namespace Cake\I18n;
use Aura\Intl\FormatterLocator;
use Aura\Intl\PackageLocator;
use Aura\Intl\TranslatorFactory;
use Cake\I18n\Formatter\IcuFormatter;
use Cake\I18n\Formatter\SprintfFormatter;
use Locale;
class I18n {
// lots of code here
public static function defaultLocale() {
if (static::$_defaultLocale === null) {
static::$_defaultLocale = Locale::getDefault() ?: 'en_US';
// the line above is the Line 229
}
return static::$_defaultLocale;
}
// many code here too
}
I've checked that another file also tries to access this Locale class, but I don't know if there are other files trying to access it as well. Many files from everywhere inside the project tries to access methods from I18n.php. I need it running but I can't figure out how to make it run.
Any help will be greatly appreciated.
As I just found out, prior to CakePHP 3.0, the installation must be done by composer, as stated in the 3.0 migration guide:
CakePHP should be installed with Composer
Since CakePHP can no longer easily be installed via PEAR, or in a shared
directory, those options are no longer supported. Instead you should use
Composer to install CakePHP into your application.
So it won't run on regular free web hosting services.

Php - Ingres, fresh install : How to debug?

I just finished to install Ingres on my server(only the client part, to connect to an existing ingres server), I just added the php_ingres module.
Now php recognize my module, so I tried to connect my self to several existing servers, but I always a
Unable to connect to database (Hostname here)
But with this I can't find what is wrong?? ingres error? Php driver? Credentials? ...?
What can I do to isolate these problem?
Most likely it's a user credentials issue. To see the actual error message use the following code:
$connection = ingres_connect(.....);
if (!is_resource($connection))
{
trigger_error(ingres_errno()." - ". ingres_error(),E_USER_ERROR);
}
You might also want to take a look at http://community.ingres.com/wiki/Ingres_with_Apache_on_Debian_Etch which outlines the setup steps for Ingres, PHP, Apache and Debian/Ubuntu.

Categories