• Resolved aclion111

    (@aclion111)


    I’m setting up my 1st WP project. Trying to get it up & running with Composer install.

    I want to have WP (/blog) in a subdir of my main site.

    My initial, pre-WP skeleton looks like

    
    	<project>
    		public/
    			index.php
    			css/
    			js
    <code>

    where my webserver doc root is

    
    	<project>/public
    

    So nav to

    
    	https://example.com/
    

    returns/renders that^ index.php.

    I want co Composer-install WP so that it’s served up at

    
    	https://example.com/blog
    

    Using @johnpbloch ‘s johnpbloch/wordpress-project

    
    	composer create-project johnpbloch/wordpress-project:dev-master wp
    

    I can install the sources anywhere, but

    (1) where *should* they be installed? under the existing <project>/public? so that I have

    
    	<project>
    		public/
    			index.php
    			css/
    			js/
    			wp/
    				composer.json
    				composer.lock
    				public/
    					index.php
    				README.md
    				vendor/
    

    ?

    or,

    (2) outside of the existing site tree so that I have,

    
    	<project>
    		public/
    			index.php
    			css/
    			js/
    		wp/
    			composer.json
    			composer.lock
    			public/
    				index.php
    			README.md
    			vendor/
    

    and then point the webserver config somehow at that <project>/wp/public/index.php for anything

    
    	https://example.com/blog
    

    ?

    I guess what I’m looking for is a how-to on composer-installing WP in a site subdir?

    ac

    • This topic was modified 7 years ago by aclion111.
    • This topic was modified 7 years ago by Jan Dembowski.
    • This topic was modified 7 years ago by Jan Dembowski. Reason: Fixing amazingly broken formatting
Viewing 3 replies - 1 through 3 (of 3 total)
  • J B

    (@johnpbloch)

    I would update the directory name in composer.json from public/wp to public/blog. You’ll still need the wp-config.php file in public so it doesn’t get deleted every time WordPress gets updated and you’ll still want to use a custom wp-content directory so you can use plugins, themes, and uploads. The default configuration in my wordpress-project repo is to use public/content for that. Update index.php so it doesn’t load WordPress and set WordPress up to use example.com/blog as the home url and siteurl.

    Thread Starter aclion111

    (@aclion111)

    @jdembowski
    Re: “Reason: Fixing amazingly broken formatting”

    I _would_ have fixed it (post-surprise that simple markdown isn’t supported), and tried — but my post edit was put on administrative/moderator hold, then some time later, posted with the option to edit it REMOVED …

    ‘preview-before-post’ would also help a great deal to avoid such editing-messes, and wasting your time, too!

    thx a lot for fixing it ‘on your nickel’, though!

    @johnpbloch
    hi. so iiuc /blog _under_ my existing public,

    <project>
        public/
            index.php
            blog/
                public/
    		index.php
                etc etc

    correct?

    It appears that johnpbloch/wordpress-project hasn’t been updated for quite a long while. afaict, it doesn’t NEED to be. for building a project based on your wp/composer skeleton, using this project *is* still the right choice?

    Finally, just since i’ve never yet done this with WP, particularly with this composer-based solution,once I’ve set up ‘your’ skeleton as above, do I still need to “run an installation” step? or is a manual config of wp-config.php sufficient?

    Thread Starter aclion111

    (@aclion111)

    got it figured out

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘WP Composer-install in a site subdirectory?’ is closed to new replies.