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.
Related
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"
}
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've been trying to install a web application which is built using the Laravel framework. The application is hosted as a GIT repository.
Here is a detailed description of my problem to clarify how I'm facing it.
For the first time I cloned the repository in the following path:
/var/www/app.example.com/script/
Then created a symbolic link to it's public directory like this to follow my server's nginx routing convention:
ln -s /var/www/app.example.com/script/public /var/www/app.example.com/public_html
But I decided to move everything out of the script directory to one upper level and this is where my problem started.
I moved the Laravel installation to /var/www/app.example.com/ and made nginx to directly load its public directory as the root path.
Now the problem is every time I try to load the application it's trying to read the files from their previous location:
Warning:
require(/var/www/app.example.com/script/public/../bootstrap/autoload.php):
failed to open stream: No such file or directory in
/var/www/app.example.com/public/index.php on line 21
Fatal error: require(): Failed opening required
'/var/www/app.example.com/script/public/../bootstrap/autoload.php'
(include_path='.:/usr/share/php:/usr/share/pear') in
/var/www/app.example.com/public/index.php on line 21
Notes to keep in mind:
I've used composer to install all the dependencies
curl -sS https://getcomposer.org/installer | php
php composer.phar install
I'm using nginx as my web server
I've tried removing everything (including ~/.composer) and start all over again to no avail.
I have even tried to move the whole project into a new root directory
It seems the problem is with __DIR__ magic constant since it contains the wrong path
Weirdly enough if I echo __DIR__ it prints the correct path but in the next line in which it's used it has the incorrect old path
I hope I have been clear enough in my description to avoid any confusion and possible down-votes.
So i could be completly wrong here, but is there a configuration file where it might have saved it? Or is there still something left in the script directory that can mabey cause this? As when the __DIR__ outputs the right value, then it should in the other code too.
The Yii2 preview was recently released and is available on github. I want to take it for a test drive, but the "documentation" so far gets outdated almost instantly since it is still under heavy development. I have tried to follow this guide on creating a simple CRUD app with Yii2, but it fails at the step:
php yiic.php app/create /var/www/yii2
With the error:
Could not open input file: yiic.php
Indicating that there is no file called yiic.php. The only folder within the framework folder is yii (framework/yii), and within that folder there is no file yiic.php, only Yii.php which when called in the command line gives the command list:
The following commands are available:
- asset
- cache
- help
- message
- migrate
Anyone managed to successfully setup a Yii2 app? Care to share how you got it done?
Seems like yiic has been removed for now, there are alternatives though, so read on.
It's all in the early stages, so the following method could break in the coming days/weeks/months. Therefore use with caution.
There are 2 ways to do this now:
Use composer. (I recommend this option.)
Directly copy the contents of yii2/apps/ directory to your apps directory, depending on the type of app you want to try.
There are currently 2 options for type of app - advanced, and basic. Both are in their respective directories within the yii2/apps/ directory, i.e yii2/apps/advanced and yii2/apps/basic.
For basic go through the basic readme.md, and for advanced go through the advanced readme.md.
The directions for using composer are given in the respective readme.md files. Including them here for completeness:
Basic app:
Install composer, if you don't have it.
Use composer to install the app alongwith dependencies(Yii):
php path/to/composer.phar create-project --stability=dev yiisoft/yii2-app-basic my_yii2_trial
Access app from http://localhost/my_yii2_trial/www
Advanced app:
Install composer, if you don't have it.
Use composer to install the app alongwith dependencies(Yii):
php path/to/composer.phar create-project --stability=dev yiisoft/yii2-app-advanced my_yii2_trial
According to readme, after step 2 app should be accessible, but composer was failing(see issue 439). With schmunk's tip, ran the install or install.bat command that gets copied by composer: ./install . Selected development environment (by entering choice 0 in the instructions that show up when running install command). Update: The command has been renamed to init, composer doesn't fail anymore, with fix from Qiang (check the issue 439 for more details).
Access app at: http://localhost/my_yii2_trial/frontend/www or http://localhost/my_yii2_trial/backstage/www
Here's how to copy the directory and get it working:
Basic app:
create your web-accessible directory for the app : my_yii2_trial
copy all files and folders from yii2/apps/basic/ directory to my_yii2_trial/ directory.
modify the my_yii2_trial/www/index.php file to point to the correct path for Yii.php.
For me it was within yii2/framework/yii/
comment the line that tries to include ../vendor/autoload.php file, I couldn't find that file anywhere, so its probably for some future use. it is the autoloader provided by composer.
Access from browser : http://localhost/my_yii2_trial/www
Advanced app:
create your web-accessible directory for the app : my_yii2_trial
copy all files and folders from yii2/apps/advanced/ directory to my_yii2_trial/ directory.
modify the my_yii2_trial/frontend/www/index.php file to point to the correct path for Yii.php. Similarly modify backstage/www/index.php.
comment the line that tries to include ../vendor/autoload.php file in both the index.php of backstage and frontend.
Access app at: http://localhost/my_yii2_trial/frontend/www or http://localhost/my_yii2_trial/backstage/www
Some important links to read more about this: issue 77, issue 108, issue 131, and wiki comment.
I am not sure how composer's autoloader is being used, so can't comment on that. Also in future versions, backstage might be renamed to backend.
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.