Image Resizing Script required - a better one...
Moderator: General Moderators
-
simonmlewis
- DevNet Master
- Posts: 4435
- Joined: Wed Oct 08, 2008 3:39 pm
- Location: United Kingdom
- Contact:
Re: Image Resizing Script required - a better one...
So I can just add:
<?php
composer require imagine/imagine
?>
?? As it doesn't like that.
<?php
composer require imagine/imagine
?>
?? As it doesn't like that.
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
All the best from the United Kingdom.
Re: Image Resizing Script required - a better one...
No. You need to type that on the command line. Alternately, copy the contents I posted into composer.json and then run
composer install (again from the command line).-
simonmlewis
- DevNet Master
- Posts: 4435
- Joined: Wed Oct 08, 2008 3:39 pm
- Location: United Kingdom
- Contact:
Re: Image Resizing Script required - a better one...
[text]php composer.phar install[/text]
How do I run this? Via CMD prompt??
I did that but it didn't like it. Maybe it needs some file path??
How do I run this? Via CMD prompt??
I did that but it didn't like it. Maybe it needs some file path??
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
All the best from the United Kingdom.
Re: Image Resizing Script required - a better one...
Yessimonmlewis wrote:[text]php composer.phar install[/text]
How do I run this? Via CMD prompt??
What does that mean?simonmlewis wrote:I did that but it didn't like it.
You want to run it from your project's root directory, where the composer.json file is located.simonmlewis wrote:Maybe it needs some file path??
-
simonmlewis
- DevNet Master
- Posts: 4435
- Joined: Wed Oct 08, 2008 3:39 pm
- Location: United Kingdom
- Contact:
Re: Image Resizing Script required - a better one...
Issue attached.
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
All the best from the United Kingdom.
Re: Image Resizing Script required - a better one...
Looks like an error in the composer.json file itself. Please post the entire contents.
-
simonmlewis
- DevNet Master
- Posts: 4435
- Joined: Wed Oct 08, 2008 3:39 pm
- Location: United Kingdom
- Contact:
Re: Image Resizing Script required - a better one...
Code: Select all
{
"name": "phpmyadmin/phpmyadmin",
"type": "application",
"description": "MySQL web administration tool",
"keywords": ["phpmyadmin","mysql","web"],
"homepage": "http://www.phpmyadmin.net/",
"license": "GPL-2.0+",
"authors": [
{
"name": "The phpMyAdmin Team",
"email": "phpmyadmin-devel@lists.sourceforge.net",
"homepage": "http://www.phpmyadmin.net/home_page/team.php"
}
],
"support": {
"forum": "https://sourceforge.net/p/phpmyadmin/discussion/Help",
"issues": "https://sourceforge.net/p/phpmyadmin/bugs/",
"wiki": "http://wiki.phpmyadmin.net/",
"source": "https://github.com/phpmyadmin/phpmyadmin"
},
"require": {
"php": ">=5.3.0"
},
"require-dev": {
"satooshi/php-coveralls": ">=0.6",
"phpunit/phpunit": "<4.2",
"phpunit/phpunit-selenium": ">=1.2"
}
"require": {
"willdurand/geocoder": "@stable"
}
}Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
All the best from the United Kingdom.
Re: Image Resizing Script required - a better one...
That's not the right composer.json. What does your directory structure look like? The composer.json in question should live in your project's root directory, not Apache's.
-
simonmlewis
- DevNet Master
- Posts: 4435
- Joined: Wed Oct 08, 2008 3:39 pm
- Location: United Kingdom
- Contact:
Re: Image Resizing Script required - a better one...
When I installed it, it just went to put it in a default area of xamp, in php/phpmyadmin.
Are you saying it needs to be installed for each and every website?
If that is the case, I guess I need to uninstall, and where it asks where to install, tell in the folder of the website.
Yes?
Are you saying it needs to be installed for each and every website?
If that is the case, I guess I need to uninstall, and where it asks where to install, tell in the folder of the website.
Yes?
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
All the best from the United Kingdom.
Re: Image Resizing Script required - a better one...
Composer itself need only be installed once. It's a program, fundamentally. Each project gets its own composer.json file, though. This allows for project-specific dependencies.
For instance, I have composer installed to /usr/local/bin/composer but will have a composer.json in ~/Sites/<ProjectName> for each project. Clear?
For instance, I have composer installed to /usr/local/bin/composer but will have a composer.json in ~/Sites/<ProjectName> for each project. Clear?
-
simonmlewis
- DevNet Master
- Posts: 4435
- Joined: Wed Oct 08, 2008 3:39 pm
- Location: United Kingdom
- Contact:
Re: Image Resizing Script required - a better one...
So if I run that composer command line again, but from the root of the project??
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
All the best from the United Kingdom.
Re: Image Resizing Script required - a better one...
Right. If you've copied the composer.json I posted earlier to your project root and runsimonmlewis wrote:So if I run that composer command line again, but from the root of the project??
composer install from that same directory, it should pull in the dependencies for just that project and save them in a vendor directory.-
simonmlewis
- DevNet Master
- Posts: 4435
- Joined: Wed Oct 08, 2008 3:39 pm
- Location: United Kingdom
- Contact:
Re: Image Resizing Script required - a better one...
Gotchya. Done it in the right directory this time.
So do I jsut add an include "file.json" to the top of my admin page?
So do I jsut add an include "file.json" to the top of my admin page?
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
All the best from the United Kingdom.
-
simonmlewis
- DevNet Master
- Posts: 4435
- Joined: Wed Oct 08, 2008 3:39 pm
- Location: United Kingdom
- Contact:
Re: Image Resizing Script required - a better one...
So I now have a composer.json file in my project with that small bit of code you told me, anbout and a big composer.lock file.
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
All the best from the United Kingdom.
Re: Image Resizing Script required - a better one...
No. You want to include the generated autoloader, which is the line that was giving you the error earlier.simonmlewis wrote:Gotchya. Done it in the right directory this time.
So do I jsut add an include "file.json" to the top of my admin page?
Code: Select all
require_once __DIR__ . '/vendor/autoload.php';