Welcome Guest, Not a member yet? Register   Sign In
CI4 and wp in shared hosting
#1

Can i use wp e codeigniter4 in the same shared hosting ?
Reply
Reply
#3

(This post was last modified: 10-27-2020, 01:29 PM by pippuccio76.)

(10-26-2020, 06:39 AM)ysarsilmaz Wrote: sure https://codeigniter.com/user_guide/intro...ments.html
This- Is not a replay , i would be know how can i do ...
Reply
#4

(10-27-2020, 01:28 PM)pippuccio76 Wrote:
(10-26-2020, 06:39 AM)ysarsilmaz Wrote: sure https://codeigniter.com/user_guide/intro...ments.html
This- Is not a replay , i would be know how can i do ...


  well if you do development on a local machine hopefully a linux one, and preferably Slackware then you have apache with a space at /var/www/htdocs to put say as a bare minimum index.html

 Then you start to get savy and want a a few projects but you only have one apache web server.

So what you do is have  sub-directories within /var/www/htdocs

I have for instance directories wp, appstarter andrinaDesignStudio  each directory is a web site in itself . To make it work i take advantage of a file called httpd-vhosts.conf  at /etc/httpd/extra  what i do is assign a slight different ip address such as 127.0.0.2 , 127.0.0.3  and in the file  set up so that the info for wp (wordpress) is:




<VirtualHost 127.0.0.8:80>
ServerName wp.com
ServerAlias www.wp.com
DocumentRoot "/var/www/htdocs/wp"
<Directory "/var/www/htdocs/wp">
Order allow,deny
Allow from All
AllowOverride All
Require all granted
</Directory>
</VirtualHost>

I do something similar for codeIgnitor except I make the document root bit end with/public


Now i more or less have a similar setup on a live server. I pay for one hosting space but via cpanel I can have subdomains and add on domains. basically i can configure so that i can have several domains pointing to respective sub directories. I don't personally have any live Wordpress sites but if you had a live wordpress site in a sub domain and another sub domain using CI4 they would for all intents and purposes be separate entities.
Reply
#5

sure, if you're using the shared hosting, and uploaded the wordpress on public_html folder, then you can create a sub folder in it for CI4.
But we need to modify the index.php file, you have to move it from public to outside and edit the location loader in the index.php file so that when you point the url to that folder it will automatically run the index.php
Reply
#6

(This post was last modified: 10-29-2020, 02:39 AM by captain-sensible.)

(10-29-2020, 01:52 AM)tmtuan Wrote: sure, if you're using the shared hosting, and uploaded the wordpress on public_html folder, then you can create a sub folder in it for CI4.
But we need to modify the index.php file, you have to move it from public to outside and edit the location loader in the index.php file so that when you point the url to that folder it will automatically run the index.php
with add on domain approach, which can be configured via cpanel, where each sub domain is a web app and for all intents and purposes separate you don't have to do anything except edit where root is for each sub domain. For Wp that would be the sub domain itself, whereas for CI4 the root would be public directory .

Thats exacly my live set up
Reply
#7

(10-29-2020, 02:37 AM)captain-sensible Wrote:
(10-29-2020, 01:52 AM)tmtuan Wrote: sure, if you're using the shared hosting, and uploaded the wordpress on public_html folder, then you can create a sub folder in it for CI4.
But we need to modify the index.php file, you have to move it from public to outside and edit the location loader in the index.php file so that when you point the url to that folder it will automatically run the index.php
with add on domain approach, which can be configured via cpanel, where each sub domain is a web app and for all intents and purposes separate you don't have to do anything except edit where root is for each sub domain. For Wp that would be the sub domain itself, whereas for CI4 the root would be public directory .

Thats exacly my live set up

yeah, if on the hosting CP had the way to edit, it's beter to config in the cpanel Smile  but i have some client that their hosting does not provide this function, so i have to modify it for the case Big Grin
Reply




Theme © iAndrew 2016 - Forum software by © MyBB