cloudfoundry-samples / cf-ex-phpmyadmin Goto Github PK
View Code? Open in Web Editor NEWCloudFoundry PHP example application: phpmyadmin
CloudFoundry PHP example application: phpmyadmin
After the php admin is up and running in the Foundry Cloud.
It seems that I cannot login to the PHP admin due to mysqli_real_connect(): (HY000/2002): No such file or directory.
$_ENV variable is no more available by default on the new versions of php buildpacks.
This could be resolved by replacing $_ENV by the function getenv() or overriding 'variables_order = "EGPCS"' in the php.ini file
if PHPMYADMIN_HASH is not set, we have this error :
Installing PHPMyAdmin 5.1.1
Traceback (most recent call last):
File "/tmp/buildpacks/8c23692cf1ba7ed1650dd13082f80f9d/scripts/compile.py", line 59, in <module>
.from_build_pack('lib/additional_commands')
File "/tmp/buildpacks/8c23692cf1ba7ed1650dd13082f80f9d/lib/build_pack_utils/builder.py", line 212, in extensions
process_extension(path, ctx, 'compile', process, args=[self])
File "/tmp/buildpacks/8c23692cf1ba7ed1650dd13082f80f9d/lib/build_pack_utils/utils.py", line 69, in process_extension
success(getattr(extn, to_call)(*args))
File "/tmp/app/.extensions/phpmyadmin/extension.py", line 42, in compile
DEFAULTS['PHPMYADMIN_HASH'],
File "/tmp/buildpacks/8c23692cf1ba7ed1650dd13082f80f9d/lib/build_pack_utils/utils.py", line 151, in __getitem__
return self.format(dict.__getitem__(self, key))
KeyError: 'PHPMYADMIN_HASH'
Failed to compile droplet: Failed to run finalize script: exit status 1
I basically want a solution like in this so post https://stackoverflow.com/questions/11305516/how-to-import-large-sql-file-in-phpmyadmin
by creating a folder "upload" and set it as the upload directory in php config.
I have a local file which selects all data from my local mysql DB table and display them.
I created a hosted DB using mysql workbench and credentials of my clearDB service and added the table.
How am i going to run it in this example here? Please Help
When I deploy my app, I'm getting
mysqli_real_connect(): php_network_getaddresses: getaddrinfo failed: Name or service not known
and
mysqli_real_connect(): (HY000/2002): php_network_getaddresses: getaddrinfo failed: Name or service not known
My guess is it sounds like the DB hostname is unreachable. I have verified that $mysql_services
in config.inc.php
has found the mysql service and it is correct.
It is an Aurora mysql instance. It has a public IP address that I can connect to fine with a standalone mysql client with no ssh tunneling or anything like that
---
applications:
- name: xxx-db
memory: 128M
instances: 1
path: .
buildpacks:
- php_buildpack
disk_quota: 2G
stack: cflinuxfs3
services:
- xxx-aurora-mysql
System-Provided:
{
"VCAP_SERVICES": {
"user-provided": [
{
"binding_name": null,
"credentials": {
"hostname": "xxx.us-east-1.rds.amazonaws.com ",
"name": "xxx",
"password": "xxx",
"port": "3306",
"username": "xxx"
},
"instance_name": "xxx-aurora-mysql",
"label": "user-provided",
"name": "xxx-aurora-mysql",
"syslog_drain_url": "",
"tags": [],
"volume_mounts": []
}
]
}
}
{
"VCAP_APPLICATION": {
"application_id": "xxx",
"application_name": "xxx",
"application_uris": [
"xxx.cfapps.io"
],
"application_version": "xxx",
"cf_api": "https://api.run.pivotal.io",
"limits": {
"disk": 2048,
"fds": 16384,
"mem": 128
},
"name": "xxx",
"organization_id": "xxx",
"organization_name": "xxx",
"process_id": "xxx",
"process_type": "web",
"space_id": "xxx",
"space_name": "xxx",
"uris": [
"xxx.cfapps.io"
],
"users": null,
"version": "xxx"
}
}
No user-defined env variables have been set
No running env variables have been set
No staging env variables have been set
Hi dmikusa,
I have treid to upload your phpmyadmin but it is failing. I am running my own cloud foudry behind the proxies.
Thanks
Narendra
Hi, this is Marco, the new PM working on the cf-mysql-release project at Pivotal. Thank you so much for this project and updating it recently - it's really helpful that this exists.
When I tried deploying this to PWS, everything worked fine till I got to, "If you need to find these, just run this command and look for the VCAP_SERVICES environment variable."
In this, it suggests to run cf files
on logs/env.log. I couldn't find that file on PWS, perhaps I'm missing something.
BUT, I did find the VCAP_SERVICES variables pretty easily by clicking on the "Env Variables" tab in the Apps Manager. Not sure if that's a preferable solution?
-- Marco N.
Dear Team,
I have an issue where i am not allowed to logon to the phpmyadmin web app after entering my credentials in the login form.
Please guide me on this.
Thank you so much,
vanchin
Hi,
I would like to use this great project in our cloudfoundry. Our mysql service is named aws_aurora. So this does not contain „mysql“ in the service type. I tried to go through the code and modified the config but a am not able to get a connection (error in „real mysql connect“). But I was able to connect via ssh tunnel and can send sql queries by console.
Would be great if you support this or either give me a hint how to modify it.
Best regards
Björn
The manifest file needs to be updated to the new style for the buildpack declaration:
buildpacks:
- php_buildpack
Hi!
We just wanted to update the phpmyadmin version from 4.8.3 to 4.8.4 and stumbled over the PHPMYADMIN_HASH
and couldn't figure out how this is calcuted (it seems not to be the SHA hashes provided on the download page).
After further investigation, I found out that the HASH is not used at all in the PHP Buildpack: https://github.com/cloudfoundry/php-buildpack/blob/master/lib/build_pack_utils/cloudfoundry.py#L167
def install_binary_direct(self, url, hsh, installDir,
fileName=None, strip=False,
extract=True):
if not fileName:
fileName = urlparse(url).path.split('/')[-1]
fileToInstall = os.path.join(self._ctx['TMPDIR'], fileName)
self._log.debug("Installing direct [%s]", url)
self._dwn.custom_extension_download(url, url, fileToInstall)
if extract:
return self._unzipUtil.extract(fileToInstall,
installDir,
strip)
else:
shutil.copy(fileToInstall, installDir)
return installDir
So maybe you could
thanks a lot,
Michael
I would like to set a large size limit and memory limit say file size to 64MB and memory limit to 128MB.
Is there some way to have the phpMyAdmin-4.4.11-english.tar.gz downloaded manually before cf push so that this works offline (without using otherwise a static buildpack separate application?)
Where the tar.gz should be - or what simplification needs to be made to the .extension script for this?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.