Welcome Guest, Not a member yet? Register   Sign In
Load view from Controller issue
#11

You can download a working ci3 news tutorial from below, you will need to change the base_url etc;

CodeIgniter 3.X News Tutorial Working.

Maybe this code can help you find out what is wrong.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#12

(This post was last modified: 06-13-2018, 10:01 AM by enelson.)

Is your view file name contact-us.php or contact_us.php?
Reply
#13

Update to the CI 3 News Download.

I added a contact page and upgrade it to CodeIgniter 3.1.9

Download link below:

CodeIgniter 3.1.9 News Tutorial

You will need to setup your base url an database I included the SQL dump for it in the root.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#14

hello,
I was read it thank you for give me a refference for that
Reply
#15

(This post was last modified: 06-15-2018, 04:38 AM by hiteshpatel1979.)

Thanks a lot.

I have done performed below steps in order to run the project locally but it did not work.

  1. Run the SQL file in PhpMyAdmin and it was FINE.
  2. Added entry into Windows host file as 127.0.0.1 ci3news.localhost
  3.  Flush the DNS cache using > ipconfig /flushdns
  4. Changed base URL protocol in config.php from https:// to http://
  5. I can ping ci3news.localhost successfully 
But when I access in the browser it does not work and shows message " This ci3news.localhost page can’t be found " .

Please look at attachments regarding my NetBeans project setup.

   

   

   

Any idea how to fix this one?

Thanks - Hitesh
Reply
#16

That's because I use Virtual Host file.

Either you can change the web server to your own or add the below VHOST Code.

Code:
#--------------------------------------------------------------
# CodeIgniter 3.1.9 News Tutorial
#--------------------------------------------------------------

#--------------------------------------------------------------
# HTTP:
#--------------------------------------------------------------
<VirtualHost *:80>
    DocumentRoot "C:/xampp/htdocs/ci3news/public_html"
    ServerName ci3news.localhost
    ServerAlias ci3news.localhost
    <Directory "C:/xampp/htdocs/ci3news/public_html">
        Order allow,deny
        Allow from all
        AllowOverride All
        Require all granted
    </Directory>
</VirtualHost>

#--------------------------------------------------------------
# HTTPS:
#--------------------------------------------------------------
<VirtualHost *:443>
    DocumentRoot "C:/xampp/htdocs/ci3news/public_html"
    ServerName ci3news.localhost
    ServerAlias ci3news.localhost
    SSLEngine on
    SSLCertificateFile "conf/ssl.crt/server.crt"
    SSLCertificateKeyFile "conf/ssl.key/server.key"
    <Directory "C:/xampp/htdocs/ci3news/public_html">
        Options All
        AllowOverride All
        Require all granted
    </Directory>
</VirtualHost>

Hope that helps.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#17

Hi there,


Man, you are a great help! I please need bit more insight.

When you say " Either you can change the web server to your own " What are the steps to do it? 
I have installed XAMPP in my Windows 10.

OR 

When you say " Add VHOST code " Do I need to add into C:\xampp\apache\conf\httpd.conf?  OR Can I create .conf file for my every  site in the localhost and reference to Apache in way so I don't need to change main httpd.conf file?

Please let me know?

Thanks - Hitesh
Reply
#18

Edit the file below.

C:\xampp\apache\conf\extra\httpd-vhosts

Make sure this is not remarked out in the file.

NameVirtualHost *:80

At the bottom of this file add this:

Include "conf/extra/vhosts/*.conf"

Create a folder called vhosts under that folder create a file vhosts.conf

C:\xampp\apache\conf\extra\vhosts\vhosts.conf

Add the code for the vhots there.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#19

Hi there,


Very much appreciated.
I forgot to ask you that in your VHOST code there is a section for SSL certificate.

How can I generate for my site (ci3news.localhost) in Windows 10 machine AND copy into the directory you suggested?

SSLEngine on

    SSLCertificateFile "conf/ssl.crt/server.crt"
    SSLCertificateKeyFile "conf/ssl.key/server.key"

I think that should be last part then I should be good to go.

It's 1.30 am here in Sydney so going to bed now.
Will check your post tomorrow morning.

Thanks - Hitesh
Reply
#20

READ:

How to test 'https' in XAMPP for localhost

Google Chrome will error on it but just go to Advance and tell it that its ok!
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply




Theme © iAndrew 2016 - Forum software by © MyBB