PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Tuesday, February 22, 2022

[FIXED] Is there a one line cmd to install wordpress locally with composer?

 February 22, 2022     composer-php, installation, wordpress     No comments   

Issue

Using laracasts I was able to install a new Laravel project by typing in laravel new project-name into the console and it will install a new Laravel install. I was looking to have the same functionality with WordPress. I found a few tutorials that mentioned that said to install WordPress with composer I would have to put a composer.json file in the folder I want to install WordPress in with

{   "require": {
    "johnpbloch/wordpress": "*"   } }

I'm trying to figure out a way to set it up so I can just type in wordpress new project-name and composer will create a folder using that name with a blank WordPress install. I'm guessing maybe I would use an alias?


Solution

laravel new project-name is probably a shortcut for composer create-project --prefer-dist laravel/laravel project-name. It basically uses laravel/laravel package as a project template and initializes your app using it as a starter. If you want similar functionality for WordPress, you need to find project template for Wordpress. You may try Bedrock as am example, but there are also other starters for WordPress:

composer create-project roots/bedrock project-name

If you really want to use wordpress new syntax, you should probably create custom wordpress command which will call composer create-project internally. But I would not recommend that, it does not give much benefits, just hides what is really happening.



Answered By - rob006
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing