uccdev

uccdev

Member Since 1 Year Ago

Experience Points
7,690
Total
Experience

2,310 experience to go until the next level!

In case you were wondering, you earn Laracasts experience when you:

  • Complete a lesson — 100pts
  • Create a forum thread — 50pts
  • Reply to a thread — 10pts
  • Leave a reply that is liked — 50pts
  • Receive a "Best Reply" award — 500pts
Lessons Completed
35
Lessons
Completed
Best Reply Awards
0
Best Reply
Awards
  • start your engines Created with Sketch.

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • first-thousand Created with Sketch.

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • 1-year Created with Sketch.

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • 2-years Created with Sketch.

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • 3-years Created with Sketch.

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • 4-years Created with Sketch.

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • 5-years Created with Sketch.

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • school-in-session Created with Sketch.

    School In Session

    Earned when at least one Laracasts series has been fully completed.

  • welcome-newcomer Created with Sketch.

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • full-time-student Created with Sketch.

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • pay-it-forward Created with Sketch.

    Pay It Forward

    Earned once you receive your first "Best Reply" award on the Laracasts forum.

  • subscriber Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • evangelist Created with Sketch.

    Laracasts Evangelist

    Earned if you share a link to Laracasts on social media. Please email [email protected] with your username and post URL to be awarded this badge.

  • chatty-cathy Created with Sketch.

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • lara-veteran Created with Sketch.

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • 10k-strong Created with Sketch.

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • lara-master Created with Sketch.

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • laracasts-tutor Created with Sketch.

    Laracasts Tutor

    Earned once your "Best Reply" award count is 100 or more.

  • laracasts-sensei Created with Sketch.

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • top-50 Created with Sketch.

    Top 50

    Earned once your experience points ranks in the top 50 of all Laracasts users.

Level 2
7,690 XP
Feb
26
4 months ago
Activity icon

Replied to Laravel CURL Project Works Fine On Local Machine - FAILS On Server?

As a followup to this, I've replaced buzzi with a different, matching server:

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
10.65. myServer myServer.website.com

However, I still have a curl error number zero. This method here:

 //gets the data from a successful curl request, and returns said data
public function setHeaders($curl) {
  echo "<h1>SetHeaders()</h1>";
  $resp = curl_exec($curl);
  $header_size = curl_getinfo( $curl, CURLINFO_HEADER_SIZE );
  $header = substr( $resp, 0, $header_size );
  $body = substr( $resp, $header_size); //$header_size
  $code = curl_getinfo($curl, CURLINFO_HTTP_CODE);
  if (curl_getinfo($curl, CURLINFO_HTTP_CODE) != 200) {
    echo "<h3>Curl errno: " . curl_getinfo($curl, CURLINFO_HTTP_CODE) . "</h3>";
    echo "<h3>Curl error(): " . curl_error($curl) . "</h3>";
    dd($body);
    return null; 
  }
  $data = json_decode($body, true);
  return $data;
}

This gives me the following output on the screen:

 "SetHeaders()"
 "Curl errno: 0"
 "Curl error(): Failed connect to my.test.instructure.com:443; Operation now in progress"

  "" [dd($body) returns an empty string]

I am trying to understand the curl error message: what does 443 mean? And why would a cURL request that succeeds on my local machine fail when coming from my server?

Any help would be very valuable.

Feb
19
4 months ago
Activity icon

Replied to Laravel CURL Project Works Fine On Local Machine - FAILS On Server?

Thank you for that. I tried both commands. To the curl --ipv4 -v "https://my.test.instructure.com/api/v1/accounts/1/admins?per_page=20" command, I got a full cURL log trace. Of the lines there, these two stood out:

HTTP/1.1 401 Unauthorized
...
"status":"unauthenticated","errors":[{"message":"user authorisation required"}

A check of my /etc/hosts file read like this:

 127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
 ::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
 143.239.2.37 buzzi buzzi.website.com

What exactly should be there instead?

Activity icon

Replied to Laravel CURL Project Works Fine On Local Machine - FAILS On Server?

cURL is definitely installed, curl -V works fine

@braunson curl_error($ch) gave me the following:

 Failed connect to my.test.instructure.com:443; Operation now in progress

From what I've read, it seems this is a timeout error?

I think it might be the program being behind a firewall. How can I check if it is?

Feb
18
4 months ago
Activity icon

Started a new Conversation Laravel CURL Project Works Fine On Local Machine - FAILS On Server?

I have a laravel project that makes a cURL request to a Canvas API endpoint. This project runs perfectly on my virtual machine. But on the centOS 7 server I've ported it to, its cURL requests don't work at all.

I get the following errors:

curl_getinfo($curl, CURLINFO_HTTP_CODE) returns curl error number 0. From what research I've done, this implies the server is refusing the connection

curl_exec($curl) returns false.

a dd of $curl or $resp dd($curl) returns a very empty string.

Below are some sample curl functions I use:

  //NOTE: $this->headers = ["Authorization: Bearer " . myServerAccessToken];
 //sets URL and $curl
 public function getAdmins() {
     $adminsURL = "https://my.test.instructure.com/api/v1/accounts/1/admins?per_page=20";
     $curl = curl_init();

     self::requestCurl($curl, $adminsURL, $this->headers);
     $resp = curl_exec($curl);
     dd($resp); //shows false
     return self::setHeaders($curl);
   }

  //something missing here?
 public function requestCurl($curl, $url, $headers) {
     return curl_setopt_array($curl, [
       CURLOPT_RETURNTRANSFER => TRUE,
       CURLINFO_HEADER_OUT => TRUE,
       CURLOPT_URL => $url,
       CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
       CURLOPT_SSL_VERIFYPEER => TRUE,
       CURLOPT_HTTPHEADER => $headers,
       CURLOPT_CUSTOMREQUEST => 'GET',
       CURLOPT_HEADER => TRUE
     ]);
   }

 //returns "curl errno: 0"
 public function setHeaders($curl) {
     $resp = curl_exec($curl);
     $header_size = curl_getinfo( $curl, CURLINFO_HEADER_SIZE );
     $header = substr( $resp, 0, $header_size );
     $body = substr( $resp, $header_size); //$header_size
     $code = curl_getinfo($curl, CURLINFO_HTTP_CODE);
     if (curl_getinfo($curl, CURLINFO_HTTP_CODE) != 200) {
       echo "<h3>Curl errno: " . curl_getinfo($curl, CURLINFO_HTTP_CODE) . "</h3>";
       dd($body); //EMPTY.
       return null;  //TODO error handling (I think returning null will be enough?)
     }
     $data = json_decode($body, true);
     return $data;
   }
    

Can anyone suggest why this might be happening, and what I could try to fix it? Any advice would be appreciated

Feb
14
5 months ago
Activity icon

Replied to Server Is Looking For Path "vendor/laravelcollective/html/src/helpers.php" Which Doesn't Seem To Exist?

Worked perfectly! The folder is there, and my server's running the site just fine now. Thank you!

Activity icon

Replied to Server Is Looking For Path "vendor/laravelcollective/html/src/helpers.php" Which Doesn't Seem To Exist?

no, it is apache apache. Over the vendor directory, permissions are drwxrwxr-x

Activity icon

Replied to Server Is Looking For Path "vendor/laravelcollective/html/src/helpers.php" Which Doesn't Seem To Exist?

I got the runtime error /var/www/MyProject/vendor/laravelcollective/html does not exist and could not be created

I gather this is a permissions issue, though I'm not sure which permissions to assign my non-root account to bypass this

Activity icon

Replied to Server Is Looking For Path "vendor/laravelcollective/html/src/helpers.php" Which Doesn't Seem To Exist?

I have two problems there, as I have two accounts. One does not have write permission over composer.json, but the other account is the root account, which the server warns me never to run composer commands from. What is the best approach to this, with that in mind?

Activity icon

Replied to Server Is Looking For Path "vendor/laravelcollective/html/src/helpers.php" Which Doesn't Seem To Exist?

I have not. Were you recommending that I call composer require laravelcollective/html on my server?

Activity icon

Replied to Server Is Looking For Path "vendor/laravelcollective/html/src/helpers.php" Which Doesn't Seem To Exist?

Sti3bas, I've run that command now successfully, and indeed, my computer version of the project has the vendor/laravelcollective/html/src folder path. I've git-pushed then pulled the project to my server version of it. However, I still do not see any vendor/laravelcollective folder path.

Has this happened before?

Activity icon

Replied to Server Is Looking For Path "vendor/laravelcollective/html/src/helpers.php" Which Doesn't Seem To Exist?

Thanks for the reply.

composer.json actually does have a laravelcollective value:

  "require": {
    "php": "^7.2",
    "fideloper/proxy": "^4.0",
    "guzzlehttp/guzzle": "^6.4",
    "laravel/framework": "^6.0",
    "laravel/passport": "^7.5",
    "laravel/tinker": "^1.0",
    "laravelcollective/html": "^6.0",
    "mtownsend/collection-xml": "^1.1",
    "mtownsend/request-xml": "^1.1",
    "mtownsend/response-xml": "^1.1"
  },

I just do not have a laravelcollective folder at all for it to point to. Having not touched this file in this project's lifetime, I can't say why.

Activity icon

Started a new Conversation Server Is Looking For Path "vendor/laravelcollective/html/src/helpers.php" Which Doesn't Seem To Exist?

I've uploaded my laravel project onto an apache server. It has an HTTP 500 error.

The logs say it's looking for the following:

 [php7:error] [pid 11339] [client 143.239.128.189:64623] PHP Fatal error:  require(): Failed opening required '/var/www/myProjectPath/vendor/composer/../laravelcollective/html/src/helpers.php' (include_path='.:/usr/share/pear:/usr/share/php') in /var/www/myProjectPath/vendor/composer/autoload_real.php on line 66``

Now, my project folder does have this path: vendor/laravelcollective/html/src/helpers.php But this is not the path that is being sought for: my project has no vendor/laravelcollective path, and yet one is being looked for.

Can anyone explain to me why it might be looking for this? I'd appreciate any insight

Feb
12
5 months ago
Activity icon

Started a new Conversation HTTP Error 500 On One Project On Server But Not The Other?

I've been uploading projects to a centos server lately. One of them is recognised, and shows me the main laravel index page.

The other is not recognised, and gives me a http 500 message.

I cannot check the logs of this page as its storage/logs folder on the server is empty.

I've checked the public directories of both and they seem to be effectively the same: they both have a css folder, a favicon.ico, a robots.txt file and an index.php file.

I change which directory the document root is pointing to. (e.g DocumentRoot = "/var/www/workingProject/public", vs DocumentRoot = "var/www/Err500Project/public")

Any advice on what I can do? I can provide more information on request, I'm just not sure what to look for