Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

342
Visualizações
Using php-ai/php-ml with php

I am using notepad++. I have installed composer and from command line I have tried to install the php-ai/php-ml using the following line of code composer require php-ai/php-ml. My cmd tells me that this is successfully installed and everything seems okay.

However, in my index.php file if I try to use any of the libraries in the package php-ai/php-ml for example: use Phpml\Dataset\CsvDataset; I get the following error:

Fatal error: Uncaught Error: Class 'Phpml\Dataset\CsvDataset' not found in C:\xampp\htdocs\test\index.php:5 Stack trace: #0 {main} thrown in C:\xampp\htdocs\test\index.php on line 5

Line 5 is the line which i request to use the library. Do i have to import these libraries or anything?

over 4 years ago · Santiago Trujillo
3 Respostas
Responde à pergunta

0

Composer files are dependecies for the project, so what you should do is:

  1. Move the composer.json and composer.lock file to the same folder as your index.php.
  2. Open a command line window, go to that folder and run: "composer install". That will create the "vendor" folder, download all dependencies and create an autoload.php in your project folder.
  3. Now you can put require __DIR__ . '/vendor/autoload.php' in the top of your index.php
over 4 years ago · Santiago Trujillo Relatório

0

Have you required the vendor/autoload.php file first in your script? This is required to auto load the classes from composer.

<?php

require 'vendor/autoload.php';

use Phpml\Dataset\CsvDataset;

$csv = new CsvDataset();
over 4 years ago · Santiago Trujillo Relatório

0

I think you will need to install dev requirements in project root directory with Composer

bin/phpunit

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda