Docker CodeIgniter 2.2.6 file upload not workingHow to set proper codeigniter base url?How is Docker different from a virtual machine?Should I use Vagrant or Docker for creating an isolated environment?How to list containers in DockerHow to get a Docker container's IP address from the host?How to remove old Docker containersCopying files from Docker container to hostCopying files from host to Docker containerKubernetes equivalent of env-file in DockerDocker link container as build argumentHow to mount a single file in a volume

Why does a helium balloon rise?

How to decline physical affection from a child whose parents are pressuring them?

Beginner's snake game using PyGame

GFCI Outlet in Bathroom, Lights not working

Credit card offering 0.5 miles for every cent rounded up. Too good to be true?

Did Darth Vader wear the same suit for 20+ years?

Other deep learning image generation techniques besides GANs?

Is it OK to bring delicacies from hometown as tokens of gratitude for an out-of-town interview?

What is the right way to float a home lab?

Word for a small burst of laughter that can't be held back

Is the decompression of compressed and encrypted data without decryption also theoretically impossible?

Chopin: marche funèbre bar 15 impossible place

Is it possible to kill all life on Earth?

Strange math syntax in old basic listing

Applicants clearly not having the skills they advertise

Did thousands of women die every year due to illegal abortions before Roe v. Wade?

How can I determine the spell save DC of a monster/NPC?

Can you please explain this joke: "I'm going bananas is what I tell my bananas before I leave the house"?

What happens if you do emergency landing on a US base in middle of the ocean?

How to provide realism without making readers think grimdark

Pros and cons of writing a book review?

Is there a practical difference between different types of Berachos?

What's the correct term for a waitress in the Middle Ages?

Why use water tanks from a retired Space Shuttle?



Docker CodeIgniter 2.2.6 file upload not working


How to set proper codeigniter base url?How is Docker different from a virtual machine?Should I use Vagrant or Docker for creating an isolated environment?How to list containers in DockerHow to get a Docker container's IP address from the host?How to remove old Docker containersCopying files from Docker container to hostCopying files from host to Docker containerKubernetes equivalent of env-file in DockerDocker link container as build argumentHow to mount a single file in a volume






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








3















I'm trying to run CodeIgniter 2.2.6 application with LAMP stack setup with Docker on windows 10. Application is up and running and even database connectivity (with mariadb) is working fine. But, when I started to create a file upload functionality, it fails. Browser saying "172.18.0.3 took too long to respond."



Here is my docker-compose.yml file:-



version: '3'

services:

php-apache:
build:
context: ./docker/php-apache
ports:
- 8081:80
volumes:
- ./app:/var/www/html
links:
- 'mariadb'

mariadb:
build:
context: ./docker/mariadb
ports:
- 3306:3306
volumes:
- mariadb:/var/lib/mysql
environment:
MYSQL_ALLOW_EMPTY_PASSWORD: "no"
MYSQL_ROOT_PASSWORD: "rootpwd"
MYSQL_USER: 'testuser'
MYSQL_PASSWORD: 'testpassword'
MYSQL_DATABASE: 'testdb_codeigniter'

volumes:
mariadb:


Here is the Dockerfile for php-apache service:-



FROM php:5.6-apache
RUN docker-php-ext-install pdo pdo_mysql mysqli

# Override with custom opcache settings
COPY ./opcache.ini $PHP_INI_DIR/conf.d/


Here is the Dockerfile for mariadb service:-



FROM mariadb:latest


And here is my folder structure:-



Here is my folder structure:-



I have app, docker folders and docker-compose.yml file in my root. Inside the app folder I have the codeigniter files.



I have a php file for upload files (upload_form.php):-



<html>
<head>
<title>FIle Upload</title>
</head>
<body>
<?= $error ?>
<?= form_open_multipart('upload/upload_file') ?>
<input type="file" name="userfile" size="20"><br/><br/>
<input type="submit" value="Upload">
</form>

</body>
</html>


When I inspect this page in google Chrome, code will interpret as follows. (Please put attention on form action part.) :-
enter image description here



After I choose a image file to upload and press upload button, page getting spin for several seconds and end up with following message:-
enter image description here



I don't know what I did wrong and any kind of help is highly appreciated. Thanks.










share|improve this question
























  • Have you checked the base URL configuration? This might help you enter link description here

    – Ranil Madawalage
    Mar 24 at 13:59

















3















I'm trying to run CodeIgniter 2.2.6 application with LAMP stack setup with Docker on windows 10. Application is up and running and even database connectivity (with mariadb) is working fine. But, when I started to create a file upload functionality, it fails. Browser saying "172.18.0.3 took too long to respond."



Here is my docker-compose.yml file:-



version: '3'

services:

php-apache:
build:
context: ./docker/php-apache
ports:
- 8081:80
volumes:
- ./app:/var/www/html
links:
- 'mariadb'

mariadb:
build:
context: ./docker/mariadb
ports:
- 3306:3306
volumes:
- mariadb:/var/lib/mysql
environment:
MYSQL_ALLOW_EMPTY_PASSWORD: "no"
MYSQL_ROOT_PASSWORD: "rootpwd"
MYSQL_USER: 'testuser'
MYSQL_PASSWORD: 'testpassword'
MYSQL_DATABASE: 'testdb_codeigniter'

volumes:
mariadb:


Here is the Dockerfile for php-apache service:-



FROM php:5.6-apache
RUN docker-php-ext-install pdo pdo_mysql mysqli

# Override with custom opcache settings
COPY ./opcache.ini $PHP_INI_DIR/conf.d/


Here is the Dockerfile for mariadb service:-



FROM mariadb:latest


And here is my folder structure:-



Here is my folder structure:-



I have app, docker folders and docker-compose.yml file in my root. Inside the app folder I have the codeigniter files.



I have a php file for upload files (upload_form.php):-



<html>
<head>
<title>FIle Upload</title>
</head>
<body>
<?= $error ?>
<?= form_open_multipart('upload/upload_file') ?>
<input type="file" name="userfile" size="20"><br/><br/>
<input type="submit" value="Upload">
</form>

</body>
</html>


When I inspect this page in google Chrome, code will interpret as follows. (Please put attention on form action part.) :-
enter image description here



After I choose a image file to upload and press upload button, page getting spin for several seconds and end up with following message:-
enter image description here



I don't know what I did wrong and any kind of help is highly appreciated. Thanks.










share|improve this question
























  • Have you checked the base URL configuration? This might help you enter link description here

    – Ranil Madawalage
    Mar 24 at 13:59













3












3








3


1






I'm trying to run CodeIgniter 2.2.6 application with LAMP stack setup with Docker on windows 10. Application is up and running and even database connectivity (with mariadb) is working fine. But, when I started to create a file upload functionality, it fails. Browser saying "172.18.0.3 took too long to respond."



Here is my docker-compose.yml file:-



version: '3'

services:

php-apache:
build:
context: ./docker/php-apache
ports:
- 8081:80
volumes:
- ./app:/var/www/html
links:
- 'mariadb'

mariadb:
build:
context: ./docker/mariadb
ports:
- 3306:3306
volumes:
- mariadb:/var/lib/mysql
environment:
MYSQL_ALLOW_EMPTY_PASSWORD: "no"
MYSQL_ROOT_PASSWORD: "rootpwd"
MYSQL_USER: 'testuser'
MYSQL_PASSWORD: 'testpassword'
MYSQL_DATABASE: 'testdb_codeigniter'

volumes:
mariadb:


Here is the Dockerfile for php-apache service:-



FROM php:5.6-apache
RUN docker-php-ext-install pdo pdo_mysql mysqli

# Override with custom opcache settings
COPY ./opcache.ini $PHP_INI_DIR/conf.d/


Here is the Dockerfile for mariadb service:-



FROM mariadb:latest


And here is my folder structure:-



Here is my folder structure:-



I have app, docker folders and docker-compose.yml file in my root. Inside the app folder I have the codeigniter files.



I have a php file for upload files (upload_form.php):-



<html>
<head>
<title>FIle Upload</title>
</head>
<body>
<?= $error ?>
<?= form_open_multipart('upload/upload_file') ?>
<input type="file" name="userfile" size="20"><br/><br/>
<input type="submit" value="Upload">
</form>

</body>
</html>


When I inspect this page in google Chrome, code will interpret as follows. (Please put attention on form action part.) :-
enter image description here



After I choose a image file to upload and press upload button, page getting spin for several seconds and end up with following message:-
enter image description here



I don't know what I did wrong and any kind of help is highly appreciated. Thanks.










share|improve this question
















I'm trying to run CodeIgniter 2.2.6 application with LAMP stack setup with Docker on windows 10. Application is up and running and even database connectivity (with mariadb) is working fine. But, when I started to create a file upload functionality, it fails. Browser saying "172.18.0.3 took too long to respond."



Here is my docker-compose.yml file:-



version: '3'

services:

php-apache:
build:
context: ./docker/php-apache
ports:
- 8081:80
volumes:
- ./app:/var/www/html
links:
- 'mariadb'

mariadb:
build:
context: ./docker/mariadb
ports:
- 3306:3306
volumes:
- mariadb:/var/lib/mysql
environment:
MYSQL_ALLOW_EMPTY_PASSWORD: "no"
MYSQL_ROOT_PASSWORD: "rootpwd"
MYSQL_USER: 'testuser'
MYSQL_PASSWORD: 'testpassword'
MYSQL_DATABASE: 'testdb_codeigniter'

volumes:
mariadb:


Here is the Dockerfile for php-apache service:-



FROM php:5.6-apache
RUN docker-php-ext-install pdo pdo_mysql mysqli

# Override with custom opcache settings
COPY ./opcache.ini $PHP_INI_DIR/conf.d/


Here is the Dockerfile for mariadb service:-



FROM mariadb:latest


And here is my folder structure:-



Here is my folder structure:-



I have app, docker folders and docker-compose.yml file in my root. Inside the app folder I have the codeigniter files.



I have a php file for upload files (upload_form.php):-



<html>
<head>
<title>FIle Upload</title>
</head>
<body>
<?= $error ?>
<?= form_open_multipart('upload/upload_file') ?>
<input type="file" name="userfile" size="20"><br/><br/>
<input type="submit" value="Upload">
</form>

</body>
</html>


When I inspect this page in google Chrome, code will interpret as follows. (Please put attention on form action part.) :-
enter image description here



After I choose a image file to upload and press upload button, page getting spin for several seconds and end up with following message:-
enter image description here



I don't know what I did wrong and any kind of help is highly appreciated. Thanks.







php apache docker codeigniter-2 docker-for-windows






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 24 at 13:20







Nadun Malinda

















asked Mar 24 at 12:32









Nadun MalindaNadun Malinda

3911




3911












  • Have you checked the base URL configuration? This might help you enter link description here

    – Ranil Madawalage
    Mar 24 at 13:59

















  • Have you checked the base URL configuration? This might help you enter link description here

    – Ranil Madawalage
    Mar 24 at 13:59
















Have you checked the base URL configuration? This might help you enter link description here

– Ranil Madawalage
Mar 24 at 13:59





Have you checked the base URL configuration? This might help you enter link description here

– Ranil Madawalage
Mar 24 at 13:59












1 Answer
1






active

oldest

votes


















3














Base URL should be absolute, including the protocol:



$config['base_url'] = "http://somesite.com/";


If using the URL helper, then base_url() will output the above string.



If you don't include the base URL it usually takes the docker IP :)






share|improve this answer























    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55323829%2fdocker-codeigniter-2-2-6-file-upload-not-working%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    3














    Base URL should be absolute, including the protocol:



    $config['base_url'] = "http://somesite.com/";


    If using the URL helper, then base_url() will output the above string.



    If you don't include the base URL it usually takes the docker IP :)






    share|improve this answer



























      3














      Base URL should be absolute, including the protocol:



      $config['base_url'] = "http://somesite.com/";


      If using the URL helper, then base_url() will output the above string.



      If you don't include the base URL it usually takes the docker IP :)






      share|improve this answer

























        3












        3








        3







        Base URL should be absolute, including the protocol:



        $config['base_url'] = "http://somesite.com/";


        If using the URL helper, then base_url() will output the above string.



        If you don't include the base URL it usually takes the docker IP :)






        share|improve this answer













        Base URL should be absolute, including the protocol:



        $config['base_url'] = "http://somesite.com/";


        If using the URL helper, then base_url() will output the above string.



        If you don't include the base URL it usually takes the docker IP :)







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Mar 25 at 4:11









        Ranil MadawalageRanil Madawalage

        685




        685





























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55323829%2fdocker-codeigniter-2-2-6-file-upload-not-working%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

            Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

            Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript