changeweb / Unifiedtransform

A school management Software
https://changeweb.github.io/Unifiedtransform/
GNU General Public License v3.0
2.84k stars 1.23k forks source link

Help needed for V1. #387

Closed Akshay-Arjun closed 1 year ago

Akshay-Arjun commented 1 year ago

Followed the steps and when i run

docker-compose run --rm composer install , the following error throws up.



stack trace: 

#0 /var/www/html/vendor/laravel/framework/src/illuminate/support/collection. Php(11): illuminate\foundation\bootstrap\handl eexceptions->handleerror(8192, 'return type of ... ', '/var/www/html/v... ', 1349) 
#1 /var/www/html/vendor/composer/classloader. Php(576): include('/var/www/html/v... ') 
#2 /var/www/html/vendor/composer/classloader. Php(4judgzvrmfdwruuwy3tojatsenwjn54lkcnkbprzduhzi5vsephfuckjnxrl2gjknrsqtcoruredagrwsqvvcjzbryftlrnydmt1a1bozvvendor/laravel/framework/src/illuminate/support/helpers. Php(110): composer\autoload\classloader->loadclas s('illuminate\\supp... ') 
#4 /var/www/html/vendor/laravel/framework/src/illuminate/foundation/packagemanifest. Php(130): collect(array)
#5 /var/www/html/vendor/laravel/framework/src/illuminate/foundation/packagemanifest. Php(106): illuminate\foundation\packag emanifest->build()
#6 /var/www/html/vendor/laravel/framework/src/illuminate/foundation/packagemanifest. Php(89): illuminate\foundation\package manifest->getmanifest() 
#7 /var/www/html/vendor/laravel/framework/src/illuminate/foundation/packagemanifest. Php(78): illuminate\foundation\package manifest->config('aliases') 
#8 /var/www/html/vendor/laravel/framework/src/illuminate/foundation/bootstrap/registerfacades. Php(26): illuminate\foundati on\packagemanifest->aliases()
#9 /var/www/html/vendor/laravel/framework/src/illuminate/foundation/application. Php(230): illuminate\foundation\bootstrap\ registerfacades->bootstrap(object(illuminate\foundation\application)) 
#10 /var/www/html/vendor/laravel/framework/src/illuminate/foundation/console/kernel. Php(310): illuminate\foundation\applic ation->bootstrapwith(array) 
#11 /var/www/html/vendor/laravel/framework/src/illuminate/foundation/console/kernel. Php(127): illuminate\foundation\consol e\kernel->bootstrap()
#12 /var/www/html/artisan(35): illuminate\foundation\console\kernel->handle(object(symfony\component\console\input\argvinp ut), object(symfony\component\console\output\consoleoutput)) #13 {main} script @php artisan package: discover handling the post-autoload-dump event returned with error code 255 ```
yungifez commented 1 year ago

What is your php version

Akshay-Arjun commented 1 year ago
There are two php images no idea about php so pasting them both here, one is unifiedtransform-php  
PHP 7.4.33 CLI NTS                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          
Second one is phpmyadmin       
PHP 8.1.17 CLI NTS                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    

More info : -> I am on Windows and Linux, and I am getting the same errors on both machines. -> Copied the .env.example to .env -> Ran docker-compose up -d -> Ran docker-compose run --rm composer install Got the above errors.

yungifez commented 1 year ago

Ill check the docker compose file for php version

But consider setting it up without docker for testingvas im busy at the moment

yungifez commented 1 year ago

Ill check the docker compose file for php version

But consider setting it up without docker for testingvas im busy at the moment

yungifez commented 1 year ago

Did you run composer install in or out of the docker container

Akshay-Arjun commented 1 year ago

I have run both of them out of the container(idk if im right) on cmd/terminal on windows/linux just like i ran docker-compose up d. Sorry i'm newbie :) To be precise, i opened the normal cmd terminal and ran the 2 codes, one after the other docker-compose up d ; docker-compose run --rm composer install

yungifez commented 1 year ago

Try running your composer install inside the container itself

Akshay-Arjun commented 1 year ago

How can i do that ? :(. Version 2 works well , but I need version 1 and I couldn't make it run. Even tried with docker-install.sh file.

kenzinotech commented 1 year ago

Try setting up a UnifiedTransform project on Windows 10 without Docker:

https://mykeels.medium.com/unifiedtransform-getting-started-in-2021-286842edacad

I am using this method and it is running fine.

yungifez commented 1 year ago

Try setting up a UnifiedTransform project on Windows 10 without Docker:

https://mykeels.medium.com/unifiedtransform-getting-started-in-2021-286842edacad

I am using this method and it is running fine.

I mentioned that but i got no response on that from op

yungifez commented 1 year ago

How can i do that ? :(. Version 2 works well , but I need version 1 and I couldn't make it run. Even tried with docker-install.sh file.

That exception looks like a php exception

You are most probably running the commands outside the container

Since this project doesn't use sail, i cannot tell which of the services the prohect is mounted on without looking at the dicker compose file

Could you take a picture of your docker desktop?

Akshay-Arjun commented 1 year ago

image Tried to start composer and artisan but they are exiting and stopping.

yungifez commented 1 year ago

Click on the php service, then switch over to the terminal

Run pwd command and post the results

Also try running compoaer install from there

Akshay-Arjun commented 1 year ago

Output of php is var/www/html it do have the contents of the website when did ls . But when tried to run composer install its showing command not found.

After installing it in docker with

php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php composer-setup.php --install-dir=/usr/local/bin --version=1.9.1 --filename=composer && php -r "unlink('composer-setup.php');" || php -r "unlink('composer-setup.php');"
/var/www/html # composer install
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - laravel/dusk v6.4.1 requires ext-zip * -> the requested PHP extension zip is missing from your system.
    - laravel/dusk v6.4.1 requires ext-zip * -> the requested PHP extension zip is missing from your system.
    - Installation request for laravel/dusk v6.4.1 -> satisfiable by laravel/dusk[v6.4.1].

  To enable extensions, verify that they are enabled in your .ini files:

So i checked the php.ini file it doesnt have complete config except few lines like memory_limit and other, copied the php.ini-development to php.ini and uncommented the extensions. But it is now showing the extensions not found errors.

Can you check if docker installing file is correct in project.

yungifez commented 1 year ago

Good, we are making progress

As a root user, or if sudo doesn't throw an error, run

(Sudo) apt-get install php-7.4-common

Also, run it with zip instead of common at the end

Akshay-Arjun commented 1 year ago

(Sudo) apt-get install php-7.4-common

Should i run it in my docker php terminal?

/var/www/html # apt-get install php-7.4-common
/bin/sh: apt-get: not found
/var/www/html #

i'm on alpine linux according to os-release. Is it what we needed?

/usr/local/lib/php/extensions/no-debug-non-zts-20190902 # cat /etc/os-release
NAME="Alpine Linux"
ID=alpine
VERSION_ID=3.16.3
PRETTY_NAME="Alpine Linux v3.16"
HOME_URL="https://alpinelinux.org/"
BUG_REPORT_URL="https://gitlab.alpinelinux.org/alpine/aports/-/issues"
yungifez commented 1 year ago

You need to find how to install the zip extension of php in that distro

A bit of googling would help