I'm currently trying to build a site in a Docker container running in an Ubuntu VM, which has Apache and PHP installed already. I want to be able to access Sqlite3 features with PHP using PDO.

However, I'm executing regular PHP to check it works, phpinfo(); which runs fine, but when I execute an SQL query I get a white page.

Has anybody had experience with implementing this before? A docker container containing Apache, PHP and SQLite? My assumption is it needs to be declared in the Dockerfile..

  • white page? Did you execute the command within the docker container? – 030 Aug 11 '17 at 7:09
  • yes, I'm running the PHP through the container on my localhost at port 8080,PHP echo commands execute OK - just not sure if there is a setting in a config that needs changing. – dburke1 Aug 11 '17 at 7:12
  • How do you execute the SQL query? Inside docker as well? – 030 Aug 11 '17 at 7:32
  • Yeah, so basically, I'm using a local data.db file and using SQLite3 with PHP and PDO in order to display the results in the web page. But, I get nothing when executed in browser. When I inspect the element of webpage, it only displays HTML tags, but when I vi the php file I get all the code. – dburke1 Aug 11 '17 at 7:34
  • Are you sure that the webpage is related to the docker instance? Could you stop the docker container and check whether the 8080 is still accessible? – 030 Aug 11 '17 at 7:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.