I try to get this done from github. https://github.com/binance-exchange/php-binance-api
I installed Xampp (latest version: 7.2.3) on a win 10 machine. Xampp is running. (at least not mysql, because it has an error while starting, but mysql is not needed). I downloaded the files from github and puttet them into my htdocs in a new folder called "binance". I downloaded the install-file for composer from here: https://getcomposer.org/doc/00-intro.md#installation-windows Installed it and choosed the php.exe out of my xampp folder inside the installation-process.
Composer starts out of the console, and it works. I put this command into the cmd:
php composer.phar require "jaggedsoft/php-binance-api #dev"
It installs some folders and files, into my project-directory. it's right.
Inside of the files downloaded from github, there is a file called:
php-binance-api-test.php
Inside this file, there are different lines like:
require 'vendor/autoload.php';
file_put_contents( getenv("HOME") . "/.config/jaggedsoft/php-binance-api.json"
But he is not able to find ".config/jaggedsoft/" because there is no folder named .config. There is also no file named php-binance-api.json only one called php-binance-api.php
I would be really thankful, if someone may try to get this run an tell me, what I have done wrong.
I have had the same problem on my Ubuntu server and I could solve it by setting HOME directory at the top of my scripts as:
putenv("HOME=/var/www/html/");
My config is at a directory of
/var/www/html/.config/jaggedsoft
File name is php-binance-api.json and file content is:
{
"api-key": "ApiKeyHere",
"api-secret": "ApiSecretHere"
}
Related
I'm trying to configure Spatie/Browsershot for a project, written in Laravel but after completing all of the steps, I still get one error:
'node' is not recognized as an internal or external command, operable program or batch file
A have installed the latest versions of node and npm and the both of them exist in the PATH and work on cmd as well.
Like it's written in the official documentation on GitHub, I've ran:
npm install puppeteer
composer require spatie/browsershot
In the code I've written:
use Spatie\Browsershot\Browsershot;
//Method to generate some random id
$unique_id = uniqid('img_');
//The path to the node and npm folders
$path_node = realpath('C:\\"Program Files"\\nodejs');
$path_npm = realpath('C:\\Users\\Hristo\\AppData\\Roaming\\npm');
//The $content is actually a stored HTML code
Browsershot::html("$content")->setScreenshotType('jpeg', 100)
->setNodeBinary($path_node)
->setNpmBinary($path_npm)
->save("$unique_id.jpeg");
Program Files is with double quotation marks, otherwise Laravel throws me an error because of the white space in between the two words.
I'm not sure about the paths, are they correctly written? (the problem with the backslashes in windows)
This little snippet helped me with the problem. As long as OS environmental variables are pointing to the node.exe file you can put this into your code
->setNodeBinary('PATH %~dp0;%PATH%;') //~dp0 : fetches current directory path in windows
Hope you get it solved
If you can run node -v and get the version of your node. Then, the error was caused by the space between "Program Files". To solve this:
Create a new folder in your local disk (C:), i.e. Programs
Move your the Node folder to the folder you just created.
Change the Node "Path" in the "User Variable" inside the "Environment Variable" i.e. C:\Programs\nodejs. NOTE: ONLY THE DIRECTORY CONTAINING THE .exe FILE IS NEEDED NOT THE FILE.
You can then use the path for the "setNodeBinary" i.e. "C:\Programs\\nodejs\\node.exe". NOTE: THE .exe FILE IS REQUIRED HERE
This should be able to solve the issue.
I try to get this done from github.
https://github.com/binance-exchange/php-binance-api
I installed Xampp (latest version: 7.2.3) on a win 10 machine. Xampp is running. (at least not mysql, because it has an error while starting, but mysql is not needed).
I downloaded the files from github and puttet them into my htdocs in a new folder called "binance".
I downloaded the install-file for composer from here: https://getcomposer.org/doc/00-intro.md#installation-windows
Installed it and choosed the php.exe out of my xampp folder inside the installation-process.
Composer starts out of the console, and it works.
I put this command into the cmd:
php composer.phar require "jaggedsoft/php-binance-api #dev"
It installs some folders and files, but not into my project-directory. It downloads and installs it into "user/vendor/..." on my drive c.
Inside of the files downloaded from github, there is a file called:
php-binance-api-test.php
Inside this file, there are different lines like:
require 'vendor/autoload.php';
file_put_contents( getenv("HOME") . "/.config/jaggedsoft/php-binance-api.json" ,
I copied the whole vendor directory into my project directory, so he can find his files.
But he is not able to find ".config/jaggedsoft/" because there is no folder named .config.
There is also no file named php-binance-api.json only one called php-binance-api.php
If I try to access some of the sample file, like web_socket_chart.php in examples, he gives me an fatal error:
Fatal error: Uncaught Error: Class 'React\EventLoop\Factory' not found in
...
this might be a file inside of the php-folder of xampp, but how does he load it before to get the class nedded?
I think i messed up the installation of composer? or do I have to choose other place for the project inside of xampp?
What is composer even good for? I would be really thankful, if someone may try to get this run an tell me, what I have done wrong.
I have my laravel project installed using homestead and I connect to it via SSH using Vagrant(on Windows). The first time I launched my project there was a message indicating i have an error in my public/index.php file indicating that directory specified in 'require' on 14 line is not found it was written like this
require __DIR__.'/../vendor/autoload.php';
then I just replaced this line of code with directory of welcome.blade.php file (require .../welcome.blade.php) (the home page of Laravel) and this page displayed each time I went to my project website but there was another message displayed saying
Illuminate\Foundation\Application' not found in
/home/vagrant/code/myProject/bootstrap/app.php on line 14.
I think that is because of the laravel version installed enter image description here
What I find quite suspicious is that I haven't got env file and vendor folder inside my project folder. vendor folder was located in AppData/Roaming/Composer folder by default. I just moved that folder to my project folder
First thing, Revert the changes within public/index.php back to how it was. That deals with autoloading and bootstrapping the laravel application and should never really be changed.
Now ssh to your vagrant box and within the laravel project, run cp .env.example .env and then edit the newly copied .env file to have all your details for DATABASE and APP_NAME.
Next, go into your project, and run composer install and this will install all the needed dependencies from the composer.json file.
And lastly, from within your project, you should now run php artisan key:generate to generate the APP_KEY.
This should fix your issue.
I would also advice that you look carefully over the documentation at https://laravel.com/docs
I'm uploading my laravel 4 app to a testing server which is shared hosting.
I'm uploading to a password protected directory which has a .htaccess file within it. My subdomain points to the public folder.
For the most part they app is working as expected I can log in, view most of the pages however every class that I have created such as a helper class and additional controllers are not being found on the live server yet all works on my local environment.
I've redone a composer dump-autoload and uploaded the composer.json file
I'm not sure where to start with this.
In my upload I've included all the files and folders to the live server (twice now). I read somewhere else I should namespace my classes but why would this help if the main laravel controllers do not namespace?
Confused - all help appreciated
When you do a composer update, if Composer finds anything new it will update some files in the folder
vendor/composer
Like the file autoload_classmap.php.
So, you have to reupload at least this folder too.
Maybe it's about git, you are pushing changings with some certain case sensitive Folders and Files, but git is changing this therefore it will work on Mac and Windows OSs but not on the server.
just use this command:
git config core.ignorecase false
above command for the current repository and you may add --global just after config keyword.
please note that ignorecase option available since version 1.5.6 and I assume you are running 2.0.x but just mentioning!
Does anyone have experience with the PHP CSV Utilities library ( http://code.google.com/p/php-csv-utils/wiki/Documentation )? I've tried to install it on my Mac--I'm running XAMPP and editing with Aptana 3. I followed the instructions and copied the CSV folder over to my project file so the organization looks like this:
xamppfiles
htdocs
MyFirstPHP
Csv
Reader.php
AutoDetect.php
Exception.php (and so on)
index.php
(xampp files contains folder htdocs, which contains folder MyFirstPHP that contains the index.php file and the CSV folder with Reader.php, AutoDetect.php, Exception.php, etc.)
When I go to create a new class of CSV_Reader, Aptana recognizes the new class and helps me create it, but when I run it in my browser I get a fatal error. I also tried a require_once like so:
require_once 'Reader.php';
I also tried requiring all of the included files (AutoDetect.php, Exception.php, etc.). Did I install the library in the wrong location? I've searched through a ton of Google documentation and blogs, but have yet to find a way to make this work successfully.