Integration of postgreSQL on WAMP - php

I have just installed the postgreSQL on windows 7. I am trying to integrate postgreSQL with WAMP server.
For this i have done the following changes in httpd.conf and php.ini file
1 LoadModule c:/path to libpq.dll in httpd.conf and then
2 extension=php_mod_pgsql.dll, extension=php_pgsql.dll -- enable(reemove ;) in php.ini
If I do the above changes the localhost does not work.
If I do the second changes the localhost work but does not load the libpq.dll.
I checked the pgsql by php script by this
<?php
echo extension_loaded('pgsql') ? 'yes':'no';
?>
The script shows "yes", but apache is not loading the libpq.dll.
Now what i should do for load the postgreSQL into the Apache2.2* (wamp)

After installation of PostgreSQL, you need to copy libpq.dll from wamp\bin\php\phpX.X.X to wamp\bin\apache\Apache2.2*\bin . And restart the Wampserver.
Download phpPgAdmin here.
Extract phpPgAdmin-5.1.zip in C:\wamp\apps So the path will be, C:\wamp\apps\phpPgAdmin-5.1.
Create a file called phppgadmin.conf in C:\wamp\alias. And copy paste the following :
Alias /phppgadmin "C:/wamp/apps/phpPgAdmin-5.1/"
<Directory "C:/wamp/apps/phpPgAdmin-5.1/">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order Deny,Allow
Allow from all
</Directory>
Left Click on the Wampserver Tray icon. Navigate to PHP > PHP extension. Then enable this
a. php_pgsql
b. php_pdo_pgsql extension.
Open C:\wamp\apps\phpPgAdmin-5.1\conf\config.inc.php,
a. find $conf['servers'][0]['host'] = ''; change to $conf['servers'][0]['host'] = 'localhost';
b. find $conf['extra_login_security'] = true; change true to false
Restart All service
Go to http://localhost/phppgadmin/ and try to login.
Default Login credentials are
Username = "postgres"
Password = "root"
references :
WAMP + PostgreSQL integration
sourceforgenet phpPgAdmin downloadable for Windows with Wamp

Thank you. These instructions worked once I also added
'Require local' to the phppgadmin.conf file:
Alias /phppgadmin "C:/wamp/apps/phpPgAdmin-5.1/"
<Directory "C:/wamp/apps/phpPgAdmin-5.1/">
Require local
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order Deny,Allow
Allow from all
</Directory>

Don't forget that WAMP has two php.ini files. One in Apache directory, one in php directory (bin\php\php5.X.X). Wampserver Tray manages the one in Apache directory.
To be able to run php cli tools (e.g php artisan), you need to uncomment the php_pgsql and php_pdo_pgsql in the php.ini in php directory.

it worked thank you
Alias /phppgadmin "C:/wamp/apps/phpPgAdmin-5.1/"
<Directory "C:/wamp/apps/phpPgAdmin-5.1/">
Require local
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order Deny,Allow
Allow from all
</Directory>

Probably the best place to start is with the msdn docs. It looks like the simplest fix is to set the %PATH% environment variable system-wide to include the path to libpq.dll.
Note that %PATH is searched last, so if a libpq is ever put into the system directory or the Apache directory it will be caught first.

After Enabling Postgresql extension from WAMP icon i was able to get postgresql admin page but bin/cake bake all command was failing with error 'php extn missing'.
(referred #rails_id's post below to complete postgresql integration with WAMP)
checked in cmd prompt with php -m, no "postgresql" module was present.
Went to php installation directory, in my case it was "C:\wamp64\bin\php\php7.2.10" and enabled (removed the ;) following pg module in php.ini file:
extension=pdo_pgsql
extension=pgsql
restarted the wamp services.
bin/cake bake all is working fine from command prompt.

Not sure why you are checking this page , but even after trying all the above and following other pages only for the reason that you have wamp already iinstalled .. then dont waste your time .
checkout below link
https://bitnami.com/ which makes you wamp integration with postgreSQL damn easy ,without WAMP server :b ,
And now start your project right away !!

Related

Wordpress installation fails on my local Wamp machine with access denied

I'm trying to install WordPress Version 4.7 localy using WAMP version 3.0.6, I've created the database and set its credentials when asked to in the installation wizard and it recognised them with no problem.
However, when I click on "install" to start the installation I get this PHP Error I suppose :
Forbidden
You don't have permission to access
/website-folder/wp-admin/install.php on this server.
Apache/2.4.23 (Win32) PHP/7.0.10 Server at 127.0.0.1 Port 80
As you can see in the error message there is /website-folder/... instead of localhost/website-folder/... , is this the error or is it something else ?
If so, any suggestions ?
I've tryed to modify the httpd.vhosts.conf file by adding Allow from all line but it didn't work in both php 5.6 and php 7.
Try following:
Find out httpd.conf file. It might be in apache/conf folder.
Add following configuration:
<Directory "{ABSOLUTE-PATH-TO-YOUR-WP-ROOD-FOLDER}">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Require all granted
</Directory>

Post request not working Drupal and Ubuntu 14.04

In my ubuntu 14.04 OS machine for drupal 7 login not working, may be it is not only login but all post request not working here. For the same filesystem and codebase it works fine in windows 7 machine.
Here is my apache server configuration:
<VirtualHost *:80>
ServerName somedomain.local
DocumentRoot "/home/mycompany/Development/Projects/Drupal/cbb"
<Directory "/home/mycompany/Development/Projects/Drupal/cbb/">
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
for above configuration when i try to submit data for login it showing..
"NetworkError: 404 Not Found - http://somedomain.local/user".
#UPDATE:
I just find out that login not working only from www.domainname.local/user path but if this login form in homepage sidebar it works fine, for all of drupal sire in ubuntu machine. With this no error message also not display.
I am in trouble for two of my drupal site in Ubuntu machine. Any help will be appreciated.
Check if .htaccess file present in drupal root directory.
Check if you've added your domain to /etc/hosts file
127.0.0.1 domain.name
Domains with 'www' and without it are totally different. Add both to /etc/hosts and to apache's config file to avoid problems.
Clear cache to avoid previous domain name which could be stored in cache.
drush cc all
If you've just added new site to apache's configuration be sure to run:
sudo service apache2 graceful
Your Apache vhost file looks like it has the key components set and I'm assuming that the .htaccess file exists in your document root and hasn't been modified from the Drupal default.
When you click on the login link in the sidebar, does it take you to http://somedomain.local?q=user/login ?
Your #update suggests that even though your Apache environment may be set up for "clean URLs", the feature is not enabled in Drupal at Administer > Configuration > Search and metadata > Clean URLs.
If modifying this compromises your access to Drupal, you can apply/disable this change via Drush (drush vset clean_url 0 --yes) or directly through MySQL (UPDATE variable SET value = 's:1:"0";' WHERE name = 'clean_url';) as per https://www.drupal.org/node/5590.
Also worth mentioning, seeing it on this related question (Very strange Drupal 7 404 behaviour): make sure that Apache modules mod_rewrite and mod_headers are enabled:
sudo a2enmod rewrite
sudo service apache2 restart

how do I enable execution of php scripts in the per-user public_html directories

I have a php script to upload files in a directory.
This works fine in apache's DocumentRoot.
When I copy the code in my /home/$USER/public_html , instead of the right output I just when a printout of the php file. I presume it does not get executed.
I was looking into the userDir module and found this
Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
includesNoExec looked promising but it is related to cgi only.
So how can I enable php scripts to be executed for every user?
Try setting this configuration:
<IfModule mod_userdir.c>
<Directory /home/*/public_html>
php_admin_value engine On
</Directory>
</IfModule>
Don't forget to restart Apache.
service apache2 restart
It turns out the important bit of code that Claudix provided is already present in the configuration files under /etc/apache2/mods-available/php5.conf
the clause there contains php_admin_value engine Off , so by setting the Claudix solution anywhere will conflict with this setting. What is more, the comment above suggests NOT to set php_admin_value engine On as it renders .htaccess files unable to disable php.
As such the correct way to run php in user www directories is by commenting out the relevant text in /etc/apache2/mods-available/php5.conf
I assume you are using apache2 on debian like I do and I think the solution
for you is to add Alias dir and set that alias dir config like below
1 edit the apache2 configuration from terminal run this command
sudo gedit /etc/apache2/sites-enabled/000-default
2 edit the path you will to execute PHP files and save
Alias /testdir /home/user/testdir
<Directory /home/user/testdir>
Options FollowSymLinks
DirectoryIndex index.php
AllowOverride All
</Directory>
3 restart apache2
sudo service apache2 restart
check If you can access the folder from browser if not probably you will have to chmod/chown the folder
yourhost/testdir
According to Apache 2.2 documentation this can be done by uncommenting this configuration line:
#Include conf/extra/httpd-userdir.conf
and modifying httpd-userdir.conf to suit your server. Based on your qustion text, this should resolve your issue.

Postgresql, phpPgAdmin in xammp

Hi I have this error while I'm trying to launch phpPgAdmin:
Your PHP installation does not support PostgreSQL. You need to recompile PHP using the --with-pgsql configure option.
I'm using XAMPP ver 1.7.7, Postgresql 9.2.4 64 bit, and phpPgAdmin 5.1.
I already did the following:
Open config.inc.php found in C:\xampp\phpPgAdmin\conf\ and set extra_login_security to false
$conf['extra_login_security'] = false;
Find php.ini file in C:\xampp\php\, then look for the line ; extension = php_pgsql.dll. Remove tag ;, so that the
result was extension = php_pgsql.dll.
(although I found php.ini- production and development so I uncomment them both)
Open C:\xampp\apache\conf\extra\httpd-xampp.conf and in section <IfModule mime_module> add
Alias /phppgadmin "c:/xampp/phpPgAdmin/"
<Directory "c:/xampp/phpPgAdmin">
AllowOverride AuthConfig
Order allow,deny
Allow from all
</Directory>
LoadFile “C:/xammp/php/libpq.dll”
but I still get this error. Can someone help me?
I am writing the answer from the beginning, not everything what you tried was wrong.
xampp is up and running.
Download phpPgAdmin and copy it into c:\xampp\phpPgAdmin
Modify the config file
C:\xampp\apache\conf\extra\httpd-xampp.conf
Add like phpMyAdmin part the phpPgAdmin part:
Alias /phppgadmin "C:/xampp/phpPgAdmin/"
<Directory "C:/xampp/phpPgAdmin">
AllowOverride AuthConfig
Require all granted
</Directory>
Restart apache and enter in browser
http://127.0.0.1/phppgadmin/
Now you would get the message: install php with –-pqsql option
Postgres installation and the configuration:
Install postgresql 32bit even if you have 64bit windows (this is not a joke)
Postgres is now up and running
Modify again the config file
C:\xampp\apache\conf\extra\httpd-xampp.conf
Add the following line (in my case PostgreSQL is installed in C:/xampp/PostgreSQL):
LoadFile "C:/xampp/PostgreSQL/bin/libpq.dll"
before the following existing lines
LoadFile "C:/xampp/php/php5ts.dll"
LoadModule php5_module "C:/xampp/php/php5apache2_4.dll"
Modify the config file
C:\xampp\php\php.ini
Uncomment the following line by removing ';'
;extension=php_pgsql.dll
Restart apache and enter again in your browser
http://127.0.0.1/phppgadmin/
It should work, it works for me
Not need to install postgresql 32 bit version just enable php_pgsql.dll extension in your php.ini file and do restart apache service
event though you get error like "cdbconnection failed to open the db connection could not find driver postgresql" then
please add below line in php.ini file and restart apache
extension=php_pdo_pgsql
Now it should work perfact
Just make sure in your C:\xampp\php\php.ini to uncomment the following line by removing ';'
extension=php_pdo_pgsql
extension=pgsql
or if you don't have those lines then add them.
Then restart Apache and it should work just fine.

While intsalling cakephp on ububtu 11.10 give rewrite_module error

I am attempting to install cakephp-1.3 on Ubuntu 11.10. I have finished all the required changes in the configuration file as mention in http://book.cakephp.org.
It shows all database connections as being setup.
Temp folder is rewrite-able.
But it give me an apache module rewrite error. I have checked the apache rewrite mode and it is enabled.
But I still get the URL_REWRITE error repeatedly and am unsure how to proceed. All help appreciated.
You should check if mod_rewrite is actually on. To do that, make a php file with
<?php php_info(); ?>
in your web root folder. At Loaded Modules you should see mod_rewrite.
If not, check for the line:
LoadModule rewrite_module modules/mod_rewrite.so
In httpd.conf (apache2.conf in UBUNTU > /etc/apache2/apache2.conf). It must be uncomented (without ; in front).
Check if AllowOverride option is on for your project. To do that, add the following line at the end of httpd.conf (apache2.conf in UBUNTU)
<Directory "/var/www/myProjectName">
AllowOverride all
</Directory>

Categories