It is that I try to obtain a list of the videos of a specific user, but I cannot proceed because it throws me the following error:
Warning: require_once(/storage/ssd1/102/066102/public_html/vimeo/autoload.php): failed to open stream: No such file or directory in /storage/ssd1/102/9066102/public_html/prueba/index.php on line 16
Fatal error: require_once(): Failed opening required '/storage/ssd1/102/9066102/public_html/vimeo/autoload.php' (include_path='.:/usr/share/pear:/usr/share/php') in /storage/ssd1/102/9066102/public_html/prueba/index.php on line 16
I have already used 4 different ways to include this file, I used:
//primer metodo
require once __DIR__ . '/vimeo/autoload.php';
//segundo metodo
require once("/vimeo/autoload.php")
tercer metodo
require once("vimeo/autoload.php")
//cuarto metodo
require_once $_SERVER['DOCUMENT_ROOT'].'/vimeo/autoload.php';
Currently all the files are located on 000webhost, all included in the public_html folder.
How do I install the library on my server?
- I downloaded the Vimeo library from gitHub
- I created a new directory on my server named vimeo
- I uploaded all the files of the downloaded library in that directory
I can't find any other method to try. Thank you and I look forward to your prompt help.
The error message is unambiguous in this case:
which means:
In the image of your file structure we see something like this:
So the path where the file would be would be:
prueba/vimeo/autoload.php
, but in yourrequire
the directoryprueba
is not used, so you will never find it.Install libraries
Installing libraries manually, by copying the folders directly, is not obvious. It is tedious, sometimes some files are not copied and updating the library to new versions is a headache.
For this reason, libraries generally indicate instructions in the same documentation to be installed by means of package managers. In PHP the most used is
composer
. In fact, the library at hand indicates how to install it via Composer :By doing this, all library files are copied to the root directory of the project.
Sometimes (very rare) Composer is not installed on the server. In that case you can install that package.
If it is impossible to install Composer, you can also copy the files using the
git
.For example this command would copy all the library files to the directory
public_html
:For this the module
git
must be installed on the server.Final note
It is always advisable to give preference to
composer
.To check if those modules are installed on the server you can run this on the command line:
composer version
git version
To install them, you would have to check the documentation according to the PHP environment you have.
The error was caused by an erroneous import of the library on the server since I was missing some key files and directories for its operation. I re-downloaded the library and uploaded it manually again and included it in my script with simple method and it worked.
Method with which I included the library
also take it out of the directory
prueba
and place it directly in the directorypublic_html
This is how the bookstore should be