Magento - using "mage" command line tool locally - php

I currently have Magento set up on a development server (remote, SSH access) and production server (Cloud instance, SSH access). The current set up is a subversion export to update the development/production servers. This works swell.
If I SSH into the dev server, I can navigate to the Mage root directory and run the following command:
./mage install community Namespace_Module
This works well on the dev server. However, when I navigate to my local path (on my machine, where I've svn co'd Magento), running the mage tool always chokes when a channel is involved. As an example, I tried:
./mage download community Namespace_Module
And received the following response:
Error:
download: Uri doesn't contain host part
I don't understand why this error occurs. I have looked into the mage tool's code and found that the error occurs when the channel URL is malformed. (The mage tool is basically a PHP script, and it uses parse_url to separate the channel URL into the appropriate parts for processing.) However, I am absolutely certain that the setup is identical locally, as it's all in svn, and I have tried many iterations of channels in an attempt to make it work locally.
The ultimate goal of all of this is to be able to run the ./mage tool to install modules on the local system, and commit them to svn from there. Ideally, running an svn status command should show me all the files that would be added/modified during the installation of the module.
Anyone have any ideas as to why this might be happening and how to make it run locally? Thanks!
UPDATE
For anyone wondering, the way I handled this was using the old pear command line tool, then running svn status to extract the downloaded package pieces into the way our systems are organized. It's definitely not ideal and I am still eagerly hoping to get an answer to my original question, but it's the ugly and painful workaround I'm using in the interim.

You should check whether you have all necessary php extentions installed localy.
Missing php5-curl might be the problem.

As you have gotten the code from another server, you might need to reinit things using:
./mage mage-setup
You could also try:
./mage channel-add http://connect20.magentocommerce.com/community

Related

How to get running on a local dev environment from an existing and complex Magento2 project

At work we took back our existing store running on Magento 2 from an external development agency. I need to get the project running in local development (with docker).
I familiarized myself with a vanilla project from the official docs and managed to get it running by downloading the vanilla template with composer, granting the proper permissions on files and folder and running the magento setup:install command.
My question is how do one goes when kick starting from an existing (production running) project?
Do I need to run setup:install again? If I do, why?
What do I need to import from production to ensure any content or configuration created via the admin is also running on my local setup? Should I import the complete Database from production?
I know our setup is using more than just php and mysql, but env.php seems to be listing only db configuration and admin url. Where can I get the complete service configuration informations about what our setup uses?
Anything else I am missing to get started with an existing project for local development?
As someone who is running Magento 2 on a local environment myself, hopefully I can shed some light on this.
If you have a direct copy of the live site, you do not need to run setup:install again.
Ensure you have a copy of the entire Magento 2 site (you can technically ignore the vendor folder, as you can run composer install and it will redownload those files, but that's up to you). Also get a copy of the entire database. Magento 2 is notorious for copying the same data to multiple tables so something could break if you don't have everything.
What do you mean by "service configurations" If you are referring to Magento 2 extensions, that data is saved in the database, not the env.php file. env.php is only for server side configurations, such as the DB information, Caching, and things of that nature. On mine, I use Redis for site Cache, so that would be included in that file as well, as an example.
When you first unpack the site to your local environment, run composer update in the directory. This will ensure you have all the proper files installed. If you are going to run a local dev environment, set the mode to development with the following command: bin/magento deploy:mode:set developer. This will allow you to make changes and to view those changes by just refreshing the page, rather than flushing cache all the time.
All queries are replied correctly by Eric. I am also not sure about "service configurations" you have mentioned here. If this is about third-party extensions/services you can check config.php file for this.

My laravel project start page is not opening

I have install Laravel in my pc using composer.
I used gitbash and started xampp control server
First I've changed my directory.
Then I've ran a command composer create-project laravel/laravel project_1. After the command had run, it installed laravel and all necessary file and key was successfully set.
Then I again changed my directory to project_1
Then I ran another command php artisan serve. After running this command Laravel development server started and 127.0.0.1:8000 this ip has genrated.
I copied the id and paste it in my browser url bar.(I copied and pasted it without using keyboard. I only used mouse)
but when I provided the ip the project_1 starting page did not open.
The page was loading and it is still loading.
what can I do? Please help
logs folder
Here is my contribution, I cannot say what is the cause but I have a solution for it; because I have such as a challenge.
run
php -S 127.0.0.1:8000 -t public
Note that the 8000 is your port, and this could be any 4-digit number.
I hope this helps
Every thing you did seems right to me in terms of Laravel requirements, so lets check some other possible issues:
make sure that your internet connection isn't configured to use
proxy, if so make sure you excluded your local address.
if you are using Internet security suite software, make sure it doesn't block your requests, this vary from software to another but you might test this by deactivating the software for a while until you try.
now that's what I have in mind, I hope it help.
First, stop the php artisan serve
After changing directory go to inside your project folder, you can run php artisan serve. Then a localhost URL will be generated for you where you can see your project in the browser
If you have PHP installed locally and you would like to use PHP's built-in development server will start a development server at http://localhost:8000
Please try to install Laragon and forget about Xampp for now. This is really cool tool and you'll start much quicker. I did try to resolve few issues with Xampp myself and always wasted a lot of time. You can google tutorials later for it as well. Plenty of info out there.
As well it comes with in house installer for Laravel ;) and more :).
Make sure that you are not coping the url from Git Bash through command, it will stop running the project
Make sure that you are not using antivirus specially avast antivirus.

Unable to install TastyIgniter

I have downloaded TastyIgniter from GitHub and running it in localhost (Windows with WAMP and PHP version 7.1.9). In the last step of installation, I am getting errors that "Downloaded files from server are corrupted" and "Missing vendor files". May I know what is causing these errors and how I can run it without bugs in my localhost.
Run composer update command in the root of your project.
If composer is not installed. Download it from this link official website.
it seems like they hardcoded something.
when you unzip the setup-master folder, keep it as it is and don't rename or move its content.
start your installation by calling:
yoursite/setup-master/setup.php
this worked for me.
I tried to run the installation previously by unzipping the files directly in my html folder and tried several fixes but no success.
after a successful installation you need to forward in your apache config / .htaccess file to the subfolder
In order to do so, don't forget to perform the Post-Installation steps mentioned here:
https://tastyigniter.com/docs/master/installation
I finished by aborting tastyigniter. After a successful installation and theme activation, the application worked fine then "suddenly" it throws an exception that the newsletter component can't be found. All suggested helps on the dev forum didn't help. Even after reinstalling the application it comes to the same error.
Apparently you won't come over a "professional" installation support by the developer ($$$)
Thats pretty much my experience, I tried to install in different servers and environments running into several issues, especially it seems not to be made for anything other but specific development environment. Trying to secure installation with SSL already is an issue, that is very standard but poorly documented with this project. Having an example of how configuration files nginx go! Pay or have an experienced server admin do the trial and error. Integrated update mechanism, get your staging server and help to code. It is ok, just would be more honest to mention upfront, that running that app in production environment requieres some serious server administration skills and is nothing like installing and maintaining a wordpress or any other mainstream script.

PHP local setup / only ever coded live

I've only ever coded to a live web server (well using a test domain and then transferring to the live one).
I actually know a decent amount of PHP, just never coded locally.
I want to also set up, learn and use Symfony2.
I also want access to the command line (as I know Symfony 2 requires this to set up bundles etc.)
I also know people integrate this with Github.
I'm using a Mac OS X 10.8.2.
I want to use Apache as the web server.
I understand everybody codes 'locally'. How do I set all this up? Maybe just a list of all the things I need. This is my rough understanding so far:
(1) Get http://www.mamp.info/en/index.html
(2) Get Composer (not sure what for though)
(3) Symfony2 download
What about command line access though?
Here a bit more info:
Installing Composer locally.
1) edit or create ~/.bash_profile
2) add this to edit (change to correct php version):
alias phpmamp='/Applications/MAMP/bin/php/php5.3.6/bin/php'
3) Refresh terminal bash:
. .bash_profile
4) Install Composer using:
curl -s https://getcomposer.org/installer | phpmamp
phpmamp is your PHP installed by MAMP

Using PHP to execute `git pull` command - deploy with github

I have been able to connect a local repository to a private Github repo (using the Github for Windows GUI), which should then automatically deploy to a development server. Everything is running smoothly until I make an attempt at the following:
<?php `git pull -f`;
Source: http://net.tutsplus.com/tutorials/other/the-perfect-workflow-with-git-github-and-ssh
Once I commit then sync/push through Github for Windows, this script is supposed to call the Linux command 'git pull -f'. I have used a SSH key without a passphrase in an effort to make it easier but to no avail. However, if I were to execute the command via command-line, everything works perfectly.
File & folder permissions are set to 777 throughout the root directory (including the /.git folder), which is what I thought was the reason for not being able to see updates when viewing the website I am developing.
If anyone has had a similar experience with this I would be grateful for a solution.
Note: I have searched high and low on SO and elsewhere on the web for a potential fix to this but any resources will be met with open arms.
Thanks,

Categories