According to the Post Number 13 from http://www.liferay.com/web/guest/community/forums/-/message_boards/message/214438;jsessionid=D538D102BA519B77651E1B65235D6A23?_19_threadView=flat
Assuming that you install/configure LIFERAY Portal setup in windows machine and Unable to access administration panel like this
STEPS:
1)Here i am using default php portal i.e sample-php-portlet (location c://liferay-portal-5.2.3\tomcat-5.5.27\webapps\sample-php-portlet)
2)Now add below code the index.php after $_POST[];
-------------------------------------------------
//CONNECTION STRING FOR MYSQL DATABASE:
$dbh = new PDO('java:comp/env/jdbc/MySQLDatabase');
if ($dbh) {
$sql="SELECT *FROM emp WHERE name = '".$usr."'";
foreach ($dbh->query($sql) as $row) {
echo "
".$row['name'] . "
";
}
------------------------------------------------------------------------
3)Add Configuration setting at the end
c:\\liferay-portal-5.2.3\tomcat-5.5.27\webapps\sample-php-portlet\WEB-INF\web.xml file
-----------------------------------------------------------------------
-----------------------------------------------------------------------
4)Add Configuration to map the database to the portal in c:\\liferay-portal-5.2.3\tomcat-5.5.27\webapps\sample-php-portlet\META-INF\context.xml file.
-------------------------------------------------------------------------------
username="root" password="kmipl" driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=UTF-8"/>
-----------------------------------------------------------------------------------
NOTE:
If context.xml is not available means, Please add a context.xml under META-INF with above content.
Adding PHP Portal using Liferay Interface.
ADD PHP PORTAL TO LIFERAY SITE
1)Click on the Add Application
2)Select sample-php-portal in the administration section and
3)Click on add link and portal will be enable on the website.
How to install liferay in windows??
ReplyDeleteGreat post, but, what you should do if you want to connect your php portlet to another datasource, different from Liferay's?
ReplyDelete