Phpmyadmin with symfony 3.4 - symfony

I'm looking how to access database with something like phpmyadmin using Ubuntu and Symfony 3.4 (I will have to work with this kind of symfony version soon).
php bin/console server:start
[OK] Server listening on http://127.0.0.1:8000
But when I try localhost:8000/phpmyadmin it's not working. I think there is a specific url when we are using this light servor, but I can't find the symfony documentation about it.
Thanks for your help.
EDIT: Can't create the database.
MySql is installed
dpkg --get-selections | grep mysql
dbconfig-mysql install
libmysqlclient20:amd64 install
libqt4-sql-mysql:amd64 install
mysql-client-5.7 install
mysql-client-core-5.7 install
mysql-common install
mysql- server install
mysql-server-5.7 install
mysql-server-core-5.7 install
php-mysql install
php7.0-mysql install
I can connect to this page: http://127.0.0.1:80/phpmyadmin/
I can connect to the symfony app on this url: http://localhost:8000/
My parameters file
# This file is auto-generated during the composer install
parameters:
database_host: 127.0.0.1
database_port: 80
database_name: symfonyTest
database_user: root
database_password: MyPassword
mailer_transport: smtp
mailer_host: 127.0.0.1
mailer_user: null
mailer_password: null
secret: b3b09e3360a0e09dfbb92723c767ec81d87235ff
But still php bin/console doctrine:database:create is not working

It won't work, It is an internal Symfony server, you should install PHPMyAdmin separately and set up a web server on your computer. also, you can use mysql workbench to have something like PHPMyAdmin in ubuntu.

On symfony 4, I unzipped phpmyadmin into my symfony's project's public/ folder
I can then access it using symfony's server via
localhost:8000/phpmyadmin/index.php

Related

How to make two virtual hosts work in same server to integrate Onlyoffice - DocumentServer

Nextcloud version : 16.0.4
Operating system and version : 18.04
Apache or nginx version Nginx 1.14
PHP version : 7.2
The issue you are facing:
I have a LEMP instance with ubuntu 18.04 ...
My /etc/hosts:
127.0.0.1 localhost
127.0.0.1 nextcloud.eduardo.com
127.0.0.1 onlyoffice.eduardo.com
I have a working instance of nextcloud in: nextcloud.eduardo.com, and i want that document server would run in onlyoffice.eduardo.com...
I have installed document server using deb package as your documentation says....
Also would like that default server would be localhost pointing to /var/www/html as usual...
I can get it to work as i dont know how to setup document server with nginx...
Here is all my configuration nginx in /etc/nginx
https://drive.google.com/drive/u/1/folders/1I2ZiRUKqmm8u5U5TsqyoOKUvfTwY-SPA

Can't setup Gitlab-ci with a symfony project

I'm trying to configure Gitlab-ci with a Symfony project, and after reading the documentation and some examples in external blogs I'm unable to complete the setup. Those are my files:
.gitlab-ci.yml:
# Select image from https://hub.docker.com/_/php/
image: php:5.6
# Select what we should cache
cache:
paths:
- vendor/
before_script:
# Install git, the php image doesn't have installed
- apt-get update -yqq
- apt-get install git -yqq
- apt-get install wget -yqq
- apt-get install zip unzip zlib1g-dev -yqq
# Install mysql driver & zip
- docker-php-ext-install pdo_mysql
- docker-php-ext-install zip
- docker-php-ext-install mbstring
# Install composer
- curl -sS https://getcomposer.org/installer | php
# Install all project dependencies
- mv app/config/parameters.gitlab.yml app/config/parameters.yml.dist
- ping -c 3 mysql
- php -v
- php composer.phar clear-cache
- php composer.phar install
- php bin/console doctrine:schema:create
services:
- mysql:latest
variables:
# Configure mysql service (https://hub.docker.com/_/mysql/)
MYSQL_DATABASE: symfony
MYSQL_ROOT_PASSWORD: password
# We test PHP5.6 (the default) with MySQL
test:mysql:
script:
- vendor/bin/phpunit --configuration phpunit.xml --coverage-text
parameters.gitlab.yml (which becomes parameters.yml.dist)
# This file is auto-generated during the composer install
parameters:
database_driver: pdo_mysql
database_host: mysql
database_port: 3306
database_name: symfony
database_user: root
database_password: password
I have tried mysql user root, and another user using 'MYSQL_USER' variable. The result is always the same:
$ mv app/config/parameters.gitlab.yml app/config/parameters.yml.dist
$ ping -c 3 mysql
PING mysql (172.17.0.2): 56 data bytes
64 bytes from 172.17.0.2: icmp_seq=0 ttl=64 time=0.282 ms
64 bytes from 172.17.0.2: icmp_seq=1 ttl=64 time=0.140 ms
64 bytes from 172.17.0.2: icmp_seq=2 ttl=64 time=0.151 ms
--- mysql ping statistics ---
3 packets transmitted, 3 packets received, 0% packet loss
round-trip min/avg/max/stddev = 0.140/0.191/0.282/0.065 ms
$ php -v
PHP 5.6.26 (cli) (built: Sep 23 2016 21:22:39)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
$ php composer.phar clear-cache
Do not run Composer as root/super user! See https://getcomposer.org/root for details
Clearing cache (cache-dir): /root/.composer/cache
Clearing cache (cache-files-dir): /root/.composer/cache/files
Clearing cache (cache-repo-dir): /root/.composer/cache/repo
Cache directory does not exist (cache-vcs-dir):
All caches cleared.
$ php composer.phar install
......
> Incenteev\ParameterHandler\ScriptHandler::buildParameters
Updating the "app/config/parameters.yml" file
> Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::buildBootstrap
> Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache
[Doctrine\DBAL\Exception\ConnectionException]
An exception occured in driver: SQLSTATE[HY000] [2002] Connection refused
[Doctrine\DBAL\Driver\PDOException]
SQLSTATE[HY000] [2002] Connection refused
[PDOException]
SQLSTATE[HY000] [2002] Connection refused
Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache handling the post-install-cmd event terminated with an exception
What am I doing wrong or missing?
The problem was in dev environment, as tackerm told me in Gitlab forum. I was using a parameters_dev.yml file on dev environment, and composer install was reading that file instead of parameters.yml as I thought. Changing database settings in parameters_dev.yml solves the error and now Gitlab is connecting and executing tests.

connecting openldap with phpldapadmin

I have 3 servers meant for openldap, phpldapadmin and client access. i have done phpldapadmin installation and i can access it through server 3 in browser http://example.local/ldapadmin
and in server 1 (openldap) i have open ldap protocol, port 389/tcp and install ldap:
yum install -y openldap openldap-clients openldap-servers
chkconfig slapd on
systemctl enable slapd
systemctl start slapd
but when i try to login it said:
can't contact ldap server (-1) for user
anyone knows how to configure openldap so it can use/manage by phpldapadmin remotely?
what configuration missing?
environment: centos 7
Thank you,
AnD
In order for this to work you have to make some modifications, after you have installed openldap and phplapadmin.
Luckily, you have centos 7 !! Just go follow these links
For Openldap, you must configure your ldap, follow this link
For phpldapadmin, follow this link
First check if openldap is accessible from the machine where phpldapadmin is installed using below command
telnet <ip-of-openldap-machine> 389
If you find port opened check below configuration settings from phpldapadmin config file. You will find config file under /etc/phpldapadmin/config.php
$servers->setValue('server','host','127.0.0.1');
$servers->setValue('server','base',array('dc=example,dc=com'));
$servers->setValue('login','bind_id','cn=admin,dc=example,dc=com');
This should do the work incase of vanilla installation of openldap server.
In /etc/phpldapadmin you will find a config.php file. In this file you specify the servers with the $server variable like this:
$servers->setValue('server','host','name_or_ip_of_your_server');
If the directory is missing you have not installed phpldapadmin correctly, to do that run:
sudo apt-get install phpldapadmin
or
sudo yum install phpldapadmin

Symfony mappig database

I have installed Symfony project under MAMP htdocs project folder, which works perfect. I them moved on to create a new Boundle, I created it just fine but I found my self in troubles doctrine.....
I am following this tutorial : Tutorial Link
The part I have stumbled on in this tutorial is:
app/console doctrine:database:create
When I run this command in my terminal I get this error:
Could not create database for connection namedsymfony
SQLSTATE[HY000] [1045] Access denied for user 'root'#'localhost' (using password: NO)
Looking at this error it that I have wrong parameters to connect to database so I checked the parameters.yml.dis file and this is what i have in it:
`parameters:
database_driver: pdo_mysql
database_host: 127.0.0.1
database_port: ~
database_name: symfony
database_user: root
database_password: ~
mailer_transport: smtp
mailer_host: 127.0.0.1
mailer_user: ~
mailer_password: ~
locale: en
secret: ThisTokenIsNotSoSecretChangeIt
debug_toolbar: true
debug_redirects: false
use_assetic_controller: true`
I tried localhost instead 127.0.0.1
I tried MAMP database_port: 8889
I tried MAMP password whihc is: root
but i keep on getting the same error
also not to sure if revelant as my apache and phpmyadmi in on MAMP, but when i run this command in my terminal mysql -u root -p this is the terminal response: -bash: mysql: command not found
About the SQL login issue
Check http://localhost/phpmyadmin in the privileges panel to see if the user root has a password defined or not and if it is allowed to access mysql via localhost (or other hosts) and if it has permissions to any database.
About the MAMP issue
Since you do not have mysql installed globally, you don't have access to it from everywhere.
Your mysql is installed locally in your MAMP so you can access it using the /path-to-MAMP/bin/mysql or something similar.

Doctrine: Could not create database for connection

I'm currently working on a website using Symfony2 and doctrine2 for the database. I did everything from this tutorial:http://tutorial.symblog.co.uk/docs/doctrine-2-the-blog-model.html
However, when I try to do this:
php app/console doctrine:database:create
I get this error:
Could not create database for connection named `CHuts_DB`
SQLSTATE[28000] [1045] Access denied for user 'rootDB'#'localhost' (using password: YES)
And this is my parameters.yml:
parameters:
database_driver: pdo_mysql
database_host: localhost
database_port: '3396'
database_name: CHuts_DB
database_user: rootDB
database_password: ***
...
database_path: null
I don't understand why it's not working. I'm fairly new to Symfony2 and I've searched a bit on internet but I couldn't find someone with the same error message as me.
In PHPMyAdmin go to:
Users -> rootDB -> Structure (check CREATE)
and save privileges of user.
I think your user and/or password aren't correct.
You can try mysql command line:
> mysql -u rootDB -p
or install adminer.php in your webserver and try to verify the account.
This solution worked for me on Mac OS X with MAMP (or MAMP Pro).
Add database.unix_socket in app/config/parameters.xml
parameters:
database.driver: pdo_mysql
database.host: localhost
database.port: 8888
database.name: my-database-name
database.user: root
database.password: root
database.unix_socket: /Applications/MAMP/tmp/mysql/mysql.sock
Add unix_socket in app/config/config.xml
# Doctrine Configuration
doctrine:
dbal:
# ...
unix_socket: "%database.unix_socket%"

Resources