I have a website running with CakePHP. Now I need to include a Wordpress blog to run along with it. The issue is that I need to make some integration, like user logins, so I'm trying to include the Wordpress file that's supposed to give that integration.
My server's file system structure is:
/root
/app (cake's app directory)
/webroot
/...
/blog (wordpress directory)
/wp-admin
/...
The installation for Wordpress went fine (I'm using a subdomain that points to this folder), so now I have both sites running perfectly by themselves.
However, as I mentioned above, I need to create some integration with them, specifically log in users in the Wordpress site when they log into my CakePHP site. I've tried doing what this other question says, but I get the following error:
Fatal error: Cannot redeclare __() (previously declared in /homepages/36/d******/htdocs/cake/basics.php:657) in /homepages/36/d********/htdocs/app/controllers/users_controller.php on line 60
I'm trying to place the code that should bring Wordpress' functions into CakePHP (require('../../blog/wp-blog-header.php');) in the users_controller, but I'm not even sure that's the right place to do that.
I've read somewhere else that sometimes different frameworks declare functions with the same name and that can cause conflict.
So I'm not sure if that's the case or I'm just placing the "integration code" in the wrong place.
Any help would be much appreciated!
You will save yourself a lot of hassle (especially when it comes to future upgrades) if you can modify your design to have 2 separate domains, and a framework in each. By doing it this way, the most complicated bit will be to implement some kind of SSO between the two...but it should be easier than trying to merge 2 frameworks (that operate completely differently).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With